Showing posts with label PIC Micro. Show all posts
Showing posts with label PIC Micro. Show all posts

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

http://www.ic-prog.com/

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

http://www.oshonsoft.com/

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
loop:
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!

My PIC Micro Experiences

It has been about 2 years that I did anything with Pic micro as I didn't have much time for that. But I did some in 2004-2006. During that time I was searching the net for studying PIC microcontrollers. I collected a lot of information.

So, here I am writing my old experience with Pic micro.

For me coding for Pic micro was not a problem. It took me only a short time to study Pic micro programming in high level languages, I have coded in Oshon Basic, PicBasic,MiKroBasic,MikroC,CCS.

My first problem to start PICing was to get a Pic Programmer . Pic Micro was not available in my area, it was only available in Ernakulum about 100+ km from my home. A ready made PIC Micro Programmer was available at Cochin but it was priced 2500Rs. At that time I couldn’t spent that much money. So I decided started to make one my own. During that time (2004) I was away from home for studying, I used to Come home only once a month. So, it took me about 4 months to build a working PIC Programmer.
In internet I found Mike Prekedo’s Elchepo. I built it but I was not able to make it working. I think I burned a 5-10 PICs. After that I found Oshon soft of Mr Vladmir Soso, There i found

A parellel port based PIC Programmer circuit & software

PIC Simulator IDE - A great PIC simulator with a basic compiler

I could successfully built this programmer and programmed a PIC16F628A,The first one I made was to blink an LED every second.After that I made another simple programmer (a JDM based one) it was a very good one, simple, serial port basedAfter making that programmer PICing became easy for me, but the components available were limited, (i didn't even get 3.2768 MHz crystal!) I made a clock, a water level controller, remote control for Pc. Some other simple ones like Pic with serial port, LCD etc. I am planning to make an embedded web server, but yet not started.

I ended my PICing a long time ago; i wish to start it all over again!

Read my next post on Starting PICing


Happy PICing