Tuesday, December 23, 2008

Start With PIC Micro Controller

This is my little post to start with pic microcontroller,
here we will look into creating a PIC programmer,Creating a test project

Download following tools

ICProg - For loading program into PICMicro
Also download IC-Prog NT/2000 driver from there


PIC Simulator IDE - We are going to use its basic compiler for the test program


Now build the Programmer

In my programmer i changed a little

Pic needs 13.2V in mclr . In circuit you can see a varible resitor in 7812 , I usded two 1N4148 instead of varible resistor to get 13.2V.

I used 2 gates of 74ls05 instead of uln2803, Also i was able to program PIC16F628A in 12V input instead of 15-18V . Its also working in the given 15-18V

Now build the test project to blink an led

I am using PIC16F628A , an led is connected to RB5(pin 11)

Now write the test code

open pic simulator IDE

goto options->Select MicroController->PIC16F628A
goto Tools->Basic Compiler

Write following code

'Set PORTB all output
TRISB = 0x00
PORTB.5 = 1
WaitMs 1000
PORTB.5 = 0
WaitMs 1000
Goto loop

Now save & compile a hex file will be generated

Load Program Into PIC

Now connect the programmer to the PC
open ic prog ,if u are using 2000/xp or higher goto options->misc->enable 2000/xp driver else error messages will come

Select device as PIC16F628A

Now load the hex file

Set options in right side

Oscilator - intRC I/O
Fuses - tick PWRT,BODEN

See screen shoot

Now in ic-prog command menu->Program all

If you successfully loaded the program to the PIC, Place the loaded PIC in the test circuit

Check! the led will blink every second!

Happy PICing!

1 comment:

Hakon said...

Many PIC12Fxxx circuit ideas on: