Mturk Jobs

Mturk Jobs
Mturk Jobs

Tank

Thursday, December 25, 2008

Run your first PIC16F84A program on simulator

You can start to test the PIC16F84A flasher program on the simulator.

The simulator is a program that simulates Microcontroller code execution and other electronic component behavior.

One good simulator I 've tried and I recommend is Labcenter Proteus 7.

You can install it and try the hardware components and software program and debug them for run-time errors and functioning errors. All this before building the real-world application on the board. This approach is very useful and can reduce developing time and frustration and eliminate situations such as you connect the circuit and get no action at all. You then wonder
what 's wrong. And you can get lost debugging hardware and software and don 't know where to
start from.

This introduction is to show the advantages of using the simulator before building your circuit board.

Let 's get started ..........

1- Install the simulator ( Labcenter Proteus 7 ).

2- Run the program ISIS.

3- Draw the components of the flasher application as in this screen-shot.




4- After you copy the code from the previous post into a file named Flasher.ASM, add the source

file as follows ;

- From the source menu , select Define Code Generation Tools ...

- Choose the MPASMWIN from the scroll menu as the screen-shot,





- Add the source form the source menu --- > Add/Remove Source files ...

and choose the code generation tools MPASMWIN and the source file Flasher.ASM




Now you have successfully configured the source file and code generation tools for code

compilation.

5- You can now compile the program by choosing the Source menu ---> Build All .

If every thing goes right, you should get the screen


6- You will notice that a Flaher.HEX file has been generated in the working folder.

7- Now double-click on the PIC16F84A component in your design , you get the window,




Choose the Flasher.HEX and set the Processor Clock Frequency to 4MHz.

8- Now press the play button to start debugging and running the program.



Now , you see the led flashing . Congratulations !!! The program is running.

We can start to build our first real-wold circuit....





If you like this blog you can support us by many ways:
   
   1. Leave comments stating your point of view about this article.

   2. Buy our book on Amazon Learn By Making.

   3. Click on links of our sponsors without adding any extra cost on you if you make purchase from them. Actually, many of these offers are totally free.
  4. Visit our new website outatime.tech.

Thank you for visiting our blog.

Wednesday, December 10, 2008

This is your first PIC16f84A program

HELLO WORLD

As in PC programming world, when you learn a new language , you start with the famous
"Hello World" program.

This program in Microcontroller is flashing a LED.

Here is the code:

;*************************************************
; Flasher.asm

list p=16f84 ; This is how you can comment
include "p16f84.inc"
org 0x00
goto start
org 0x20
start
bcf INTCON,7
movlw 0x00
bsf STATUS,5
movwf TRISB
bcf STATUS,5
again

movlw 0x80
movwf PORTB

call delay

movlw 0x00
movwf PORTB

call delay

goto again



delay
movlw 0x01
movwf 0x0e
loop3
movlw 0xfa
movwf 0x0d
loop2
movlw 0xfa
movwf 0x0c
loop1
decfsz 0x0c,1
goto loop1
decfsz 0x0d,1
goto loop2
decfsz 0x0e,1
goto loop3
return
end

;*********************************************************************

1 - Copy the above text and paste it in an empty text file and save it as Flasher.asm

2 - Install the MPLab program and search for the file MPASMWIN.EXE in its path.

3- Run the program. It looks like this :



Uncheck the case-sensitive option.

4 - Browse for the Flasher.asm file and press Assemble.

If every thing goes write , you will have the window :

Congratiulations, the assemble process is complete !!
The Flasher.hex file will be generated in the same directory of Flasher.asm


Note : If you like this blog ( or don't ) , please give me feedback by commenting. Thanks ...






If you like this blog you can support us by many ways:
   
   1. Leave comments stating your point of view about this article.

   2. Buy our book on Amazon Learn By Making.

   3. Click on links of our sponsors without adding any extra cost on you if you make purchase from them. Actually, many of these offers are totally free.
  4. Visit our new website outatime.tech.

Thank you for visiting our blog.

Monday, December 8, 2008

Getting Started With PIC16F84 Microcontroller Programming

Resources needed for a Quick jump-start :

For the simplicity of the learning process for the beginner, I 'll start with the most famous Microchip PIC16F84 ( which was the first uC I learned )

You need to prepare these stuff before start programming :

1- The target IC (the uC PIC 16F84A) and its Datasheet .


2- Programming circuit ( JDM programmer ) - you need to build it your self - or buy a Microchip PIC programmer.



3 - Loader program ( ICProg ) - you 'll need it if you use JDM programmer - , but if you buy a ready-made programmer , you will have the software with it.


4 - MPLab program ( to assemble ) the programs you write in Assembley .




5 - HiTec PICC ( to compile programs in C ) .






6 - Proteus 7.0 Simulator

















You can get all these stuff for FREE from the Internet.






If you like this blog you can support us by many ways:
   
   1. Leave comments stating your point of view about this article.

   2. Buy our book on Amazon Learn By Making.

   3. Click on links of our sponsors without adding any extra cost on you if you make purchase from them. Actually, many of these offers are totally free.
  4. Visit our new website outatime.tech.

Thank you for visiting our blog.

Sunday, December 7, 2008

Microcontroller Tutorial : PIC16f84A

I decided to start a Microcontroller Tutorial for beginners. If you like to learn about Microcontroller programming and embedded systems , this blog may be helpful.

Prerequisites:

All you need to know before start programming your microcontroller is basic programming knowledge, basic electronics and Boolean Algebra ( AND , OR & NOT gates ... ) .

And the first thing to know is:

What is the Microcontroller?

It is a smart IC that can be programmed to do some task. Unlike a typical IC which does a certain function that cannot be changed, the Microcontroller function is defined by its software code written on it. you can change the code when you want and thus change its function. Smart means it can decide and take actions according to its code.

So what 's the difference between Microcontroller(uC) and Microprocessor(uP) ??

uP needs some other devices to be able to work ( BIOS, RAM, I/O Ports , ... ) all these devices are other IC 's.

Although the uP is more general purpose than than the uC , but the fact that the uC contains all the required devices in one package ( EEPROM, RAM, IO Ports , ADC , UART , etc ... ) overcomes the limited abilities and small instruction set of the uC.






If you like this blog you can support us by many ways:
   
   1. Leave comments stating your point of view about this article.

   2. Buy our book on Amazon Learn By Making.

   3. Click on links of our sponsors without adding any extra cost on you if you make purchase from them. Actually, many of these offers are totally free.
  4. Visit our new website outatime.tech.

Thank you for visiting our blog.

Saturday, December 6, 2008

It all started with the computer

It all started with the computer


I started with the old computer AQUARIUS at the 80 's. It had Microsoft Basic on it. I learned programming in Basic. I then got my Pentium 1 at 90's.









I learned Microsoft DOS and Windows. Then I learned C language.

I got AMD PC at year 2000 and I learned more about PC hardware.

I also knew about Microcontrollers ( Microchip PIC , Atmel , Renesas ) .

I programmed Microcontrollers in Assembly and C.

At 2006 I got Toshiba Satellite Notebook.

This year, I joined the Renesas HTS contest. I submitted my project " Multichannel Oscilloscope" and guess what , I had the forth honored mention.








http://www.renesasrulz.com/thread/2225;jsessionid=7AFAE50480BD5DF2D4D3F616A03277EA?decorator=print&displayFullThread=true




If you like this blog you can support us by many ways:
   
   1. Leave comments stating your point of view about this article.

   2. Buy our book on Amazon Learn By Making.

   3. Click on links of our sponsors without adding any extra cost on you if you make purchase from them. Actually, many of these offers are totally free.
  4. Visit our new website outatime.tech.

Thank you for visiting our blog.

Tank