buy hot The Fixer cool video Year One download Kasabian album nice Terminator Salvation hit cool track Jordin Sparks USA Whatever Works video download Check My Brain melodies nice video Finding Nemo nice Pop - Various Artists hit cheap DIVX Year One

digital-diy.com

PIC Micro's For Beginners Print E-mail
( 2 Votes )
  
Monday, 09 March 2009 11:53
Article Index
PIC Micro's For Beginners
Your first program
Program a PIC
Hardware
Wire up a PIC
Voltage Regulator
PICKit 2 Guide
All Pages

If you run into issues with this guide or others on the site, please check out the digital-diy.com forums and feel free to post or help others!

PIC's are small programmable IC's that have many pins which can be turned into inputs and outputs for any range of tasks. With this incredible feature, coupled with many other 'built-in' peripherals, PIC micro's have infinite uses for projects and applications.

There are many ways to program a PIC, wether it be the type of programmer or the compiler (software used to develop programs), the first couple of stepping stones entailing programming your first PIC are usually where people give up. This basic guide is designed to get you off your feet, and program your first PIC, by not using dodgy programmers or software, just explaining the raw real truth of what are the best tools to use for PIC development.

Before I get much further, I would like to clear one fact up, there are different families of PIC's, in particular, the 16Fxxx range and 18Fxxxx range. There are others, but these two are the most popular and supported. Briefly said, Microchip never discontinues a product range. They offer continual support from the date of release, until the present day. With this in mind, there are many types of PIC's out and about, some are very old. The 16F range is old, and while they have no errors, they do have flaws in regards to the way memory is handled in particular. This is why I really recommend using 18F PIC's, they are newer, operate faster, and have a lot more features ready to go.

To start off with, I bet your wondering how we control the state of pins on a PIC, first of all, lets have a look at the pin-out of a PIC micro, in this case the 18F1320. Here's what one looks like in real life;

00005227_2236236



And this is the pin-out of the PIC (pin 1 can be identified as the one to the left of the indent on top of the IC)

img22



It looks like jargon if you haven't played with PIC's before I know... The next learning curve is the PIC's pins are grouped into ports. As you can see, pin 1 is RA0, this means PORTA pin 0. Pin 2 would be PORTA pin 2. As you work your way around the PIC, you will notice that the pins for each port are not necessarily sequential according to their physical location, and you will also see pins labelled MCLR (pin 4), Vss (pin 5) and Vdd (pin 14), amongst others.

These newly discovered pins are the "vitals" for the PIC to operate. Vdd is the positive supply, Vss is earth and MCLR is a hardware reset pin, and must remain high or else the PIC's program will reset. The supply voltage for PIC's is typically 5 volts, some can go lower then that, but for all tutorials besides those that specify different, Vdd refers to 5 volts. Your power supply should be your first project, and it utilises a 7805 IC which has three pins, input, ground and output. Put simply, it turns any voltage above 6.5 volts and up to 12v into a steady and very stable 5 volts. More can be found on the how to build a voltage regulator tutorial.

Start_slow_finish_strong

 



Comments (3)
  • BobbyD  - I wish I would hve found this site sooner!!!

    :woohoo:
    Excellent explanation of the basics. it took me a LONG time to self learn what you exlained in an easy to follow and systematic way.
    I am looking forward to reading and "Seeing" more.
    :)

  • Kevin  - Great Site

    The infomation on this site is (I would say) batter than anything on Microchip's site!!! Love it!!!

  • Ahamed Mustafa  - The most helpful content

    I find this article to be the most helpful for beginners like me... :)...Excellent content and presentation...Thank u so much.

Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
Security
Please input the anti-spam code that you can read in the image.
Last Updated ( Saturday, 09 January 2010 01:57 )
 

Whos Online

  • andyo
  • Jon Chandler

Forum Activity