P1   P2   P3
Home


Buying PICkit-2
Learn about PIC12F629
PIC12F629 Data Sheet (.pdf  4,926KB)
Instruction Set for PIC12F629
blank12F629.asm template
Notepad2.zip     Notepad2.exe 
PIC12F629.asm  Chip as a "D" flip flop
Library of Sub-routines "Cut and Paste
"
Library of routines:   A-E   E-P    P-Z 
 

 

This project is going to get you into PIC programming for $5.00.
The
PIC12Fxxx Proto Board costs just $5.00 and includes a surface-mount PIC chip.
This whole concept has some advantages and some disadvantages.

The advantages are these:
1. It will get you onto PIC programming.
2. It will introduce the concept of "In Circuit Programming."
3. It will introduce surface-mount technology.

The disadvantages:
1. The chip is difficult to solder to the board.
2. The chip cannot be removed and put into another project.
3. You need to buy another chip if you want to use the program in another project.

The decision is yours.
But there is no cheaper way to start with microcontrollers.

Buying the
PIC12Fxxx Proto Board is just the start. There are other things you will need.

1. A "Burner." You will need a device that "loads" or "burns" the program into the chip. The best programmer is PICkit-2 from Microchip. (cost $50.00 USD plus postage).
2. A 5/7 pin connector to fit between the programmer and the board. This can  be purchased from Talking Electronics for $2.50.
3. A set of surface-mount components including 6 pins, resistors, capacitors, battery holder, 2 lithium cells, 10-LEDs, piezo, LDR, 10mH inductor,  6 surfeace-mount transistors and 5-mini PCB mount switches. This kit of parts can be purchased from Talking Electronics for $20.50
4. The
PIC12Fxxx Proto Board.

FIRST PROJECT   see Hello world .pdf


EXPERIMENTS
Before carrying out any of the experiments, you will need to install software from the CD's that come with PICkit-2 and place a number of icons on your desktop.
1. Create a folder called AllPICkit-2Files. Click on the folder and create a shortcut to desktop.
2. Install Notepad on your computer (NotePad.exe  NotePad.zip) and create a shortcut to desktop.
3. Install MPASM and create a shortcut to desktop.
4. Install PICkit-2 and create a shortcut to desktop.
Places these 4 icons in a row in the same order.
Download expts.zip and unzip them into AllPICkit-2Files folder.

Here are additional things you will need:
Read the article: Start Here with PIC12F629
Look at: Library of Routines.
Read: PIC12F629 Datasheet
blank12F629.asm template
Look at: PIC12F629 Instruction Set
 

You can jump off the "deep end" and start the experiments, or read-up about the chip in the documents above.
 



EXPERIMENT 1
 

FLASH A LED

The first thing you will want to do is create a program to flash a LED, to make sure everything is working.
Connect a LED to pin xxx via a 470R resistor and burn the following program into the chip.
This is not a "normal" program. It uses the watchdog timer to reset the chip and this produces the on and off time. This is not the normal use for the watchdog timer. It normally monitors a program and if the micro gets stuck in a routine or jumps to an incorrect section of the program, the micro is reset.
(It is able to do this because the programmer adds an instruction to clear the watchdog timer at various location in a program (such as a delay routine) and the timer counts down every time an instruction is executed. It the program executes too many instructions without clearing the wdt, it gets reset.)
This program also uses the "sleep" function. This is similar to putting it into an endless loop. The program will execute too many instructions s and the wdt timer will reset the micro.
The XOR instruction changes each bit in a file from "0" to "1" or "1" to "0." That's how the LED is turned on and off. We have used one of the bits in the input-output port and connected it to the LED and this bit is made "1" to produce a HIGH and "0" to produce a LOW.
 .






 

P2   P3

 

 

 

 

 

 

 



  28/8/08