Beginners checklist for PIC Microcontrollers

  1. PICList: Subscribe to the PICList http://www.piclist.com. Don't post, just read for a while.
  2. PIC: Select a chip and buy one.
  3. Static - don't touch the pins without grounding yourself.
  4. Programmer Find a programmer that supports your chip.

    (The exhaustive list of all known programmers is at /techref/microchip/devprogs.htm )

  5. DO NOT ENABLE CODE PROTECTION! No, it can't be undone. You will have to replace the chip. Read the documentation on your programmer to figure out how to avoid this.
  6. Read Goto http://www.microchip.com find, download and read the datasheet for your chip from cover to cover. Read  Jim's introduction to the PIC, the PIC FAQ and ask questions on the PICList if you don't understand something. If your brain is completely fried at this point, don't worry, lots of top-notch engineers have been also. Here are some other ideas:
  7. Language: Select a development language. Many years ago everyone used assembly language because there was no alternative. A few years ago many people used assembly language because the alternatives were expensive. Now there are lots of alternatives, many of them free. See development language.
  8. Start with very simple code like a LED coming on when a switch is pressed, and build from this once it is working.
  9. Don't Float: Tie the switch pin Hi or Lo with a ~10K resistor or use internal pullups to avoid floating inputs when the switch is open. In general, do something with unused pins don't just leave them floating
  10. TRIS - make sure they are set properly for in/out pins.
  11. Debounce the switches to avoid false switch states.
  12. RA4 on a 16F84 is "open collector" - it can pull to ground but will not pull up to Vcc. You can still use it to drive LEDs by hanging the LED & resistor between RA4 and +5V supply. (anode to +5V) This means that the logic is now inverted; 1 = off and 0 = on
  13. Diasble WDT if not needed
  14. Check MCLR is connected to Vcc
  15. Connect ALL Vcc and Vdd pins. Not just one of each.
  16. Make sure Osc fuses are set for your type of oscillator, crystal (XT), RC (RC), resonator (HS).  etc
  17. Sample code for most common applications (including serial io, LCD interfaceing, keyboards, the internet, etc...) are available at the PICList FAQ http://www.piclist.com/faq
  18. When your code doesn't work:
    1. Set the entire program aside, find a way to seperate just a small, but functional part of it and get that part working. Then, slowly add in the rest of the code from the original program, testing and debugging each addition, untill you have the entire program working
    2. Comment each and every line of the code with what you think it is doing, and then check the datasheet against your comments.
    3. Post the commented code to the piclist with a subject line of "[PIC]: What am I missing in this code?"
  19. For good ideas on second and third projects, see: http://www.piclist.com/projects. Good starting projects with lasting value.

Still not getting anything to work? Try

If you are going to do this for a living, see the begining engineers checklist

Questions:

See also:

Archive:

Comments:

See:

Bert van Dam Says:

http://members.home.nl/b.vandam/lonely/index.html Has lot's of information including a 'Getting started'and 'Tutorial' section for beginners using JAL as PIC language. Also contains may pages for intermediate and experts.

Interested: