Begining microcontrollers programming with PIC

If someone wants to start programming microcontrollers, PIC family is for sure the best choice. PICs are inexpensive and easy to learn, powerful enough for beginner applications and they have a lot of integrated peripherals that make them even more powerful.

The required software can be freely downloaded by Microchip's site. Don't forget to download databooks for your PIC microcontroller, probably PIC16F84, from the same place.

Nobody ever was able to program without read, understand (and many times copy) some examples. If someone google "Pic Projects" many sites will be found. Most of them present home made projects with freely available source code. A good place to start with is rentron's site. Of course useful application notes from Microchip's site will provide a sufficient background but be careful because some of them are rather advanced.

A very nice book (in affordable price) that someone could buy and read is the PIC Microcontroller Project Book. It describes a lot of projects and the connection of a PIC with a lot of peripherals.

Of course every microcontroller needs some hardware programmer to download the program to the IC. IC-Prog and its hardware companions are the best place to start. Easy to use, easy to create programmers and of course free. When you get more professional I guess you will need a PICSTART Plus official programmer from Microchip which is more reliable.

In conclusion what someone may need to start programming with PIC microcontrollers are the following:

  • Download MPLAB IDE (www.microchip.com)
  • Create mini programmer (www.ic-prog.com)
  • Study examples (www.microchip.com, www.rentron.com/pic.htm, www.google.com)
  • Debug and gain experience

Good luck!


Upgrading from PIC to AVR

The war between PIC or AVR is not over! Nobody can easily tell which is better. According to my opinion, AVRs are much more powerful because of their C-optimized instruction set and the one - cycle per instruction architecture. Their drawback in comparison with PIC is that that have more assembly instructions to learn and that they are less years in the market. The differences between the two families are summarized in the following table.


PIC AVR
One instruction per 4 clock cycles (4Mhz = 1MIPS) One instruction per clock cycle (4Mhz = 4MIPS)
Wide voltage range and reliable operation in conditions that exceed specifications Work only under condition that conform to the specifications
Most parts require an external clock source (e.g. crustal) Most parts are able to work by using AVR's internal clock sources.
More years in the market About two years less in the market
Easy to lern instruction set (only 33 asm instructions) More instructions (110 asm instructions)
More than one operations to achieve simple tasks Everything can be completed with one ore two instructions
Difficult indirect memory access and computed gotos Very easy indirect memory access and computed gotos with pointer registers and special instructions
Difficult to use Memory and Program memory paging Easy to use memory model
Development enviroment: MPLAB IDE Development enviroment: AVR Studio
Device specific assembly difficult to compile C code to Assembly optimized for use with C compilers and similar to other mCs
Many support devices, Simulators - Programmers integrated with IDE STK 500 all in one. Complete integrated into the IDE
Easy to learn, introductory, perfect for educational use High performance, more powerful assembly, less expensive
Home Electronics Programming My documents Find

Οι κατασκευές, τα προγράμματα και όλο το περιεχόμενο του site ανήκουν σε εμένα προσωπικά, όσο αυτό δεν παραβιάζει δικαιώματα άλλων και δημοσιεύονται για ενημερωτικούς σκοπούς. Καμία εγγύηση δεν παρέχεται για οποιαδήποτε χρήση τους και καμία ευθύνη δε φέρω για οποιεσδήποτε ζημιές μπορεί να προκαλέσουν. Για επαγγελματική χρήση ή αναδημοσίευση μέρους ή του συνόλου του περιεχομένου του site, επικοινωνήστε μαζί μου.

Δημήτρης Κουζής - Λουκάς | (c) 2001-2004 | Dimitris Kouzis - Loukas