Saturday 13 October 2007

Choosing PIC Microcontrollers

Choosing PIC Microcontrollers

When starting a new microcontroller project it's often difficult to decide what sort of microcontroller to use. If you don't have a specific project but want to play with microcontrollers for learning purposes, it's probably best to start with a simple, mid-range device. High-end devices have many complicated modes and large manuals which can be confusing. But moving up to a larger micro from a smaller one is easy. The PIC series is very well designed and uniform throughout the line. This means that learning done on one PIC is easily adapted to a different device.

For new users, the PIC16F627A is highly recommended. It is modern and powerful, but still very easy to use.

For users with specific applications, generally the following criteria should be considered:

  • I/O - How many and what kinds of I/O are required? Be careful when simply counting I/O pins from a specs sheet. Not all I/O pins are the same, and not all of the features can be used at once.
  • Processing Power - Make sure that your application is a reasonable one for a micro. Don't expect to decode MPEG movies on a microcontroller. (at least not in 2006 anyway) As microcontroller projects get more complex, it's often a hard choice between a complicated custom microcontroller project and a small embedded PC or Arm board that can run a full OS. Some applications just work better on a full PC.
  • Storage - Most micros don't have very much RAM and ROM. If you need to store a lot of data, you might need to interface with external memory. Be careful not to underestimate the I/O bandwidth requirements of moving a lot of data around. Sometimes a larger processor is required for memory reasons and not for processing power reasons.

Here are some PIC suggestions:

  • PIC10F200 - The world's smallest microcontroller! Only 6 pins, 4 of which are I/O pins. If you need a little processor for something special, at $1 and the size of a grain of rice this is a great alternative to logic gates for many low-speed applications. A J/K flip-flop can toggle a light on and off, but the PIC10F200 can toggle the light on and off, debounce the switch, and even do dimming... all in software!
  • PIC16F627A - A low cost (<$2) PIC with a lot of power. There are larger version with more memory, but this small PIC has a serial port, timers, PWMs, interrupts, and a good amount of I/O.
  • PIC16F87x - These PICs offer lots of choices of I/O and memory sizes, with the addition of A/D converters and more.
  • PIC18F252/PIC18F2520 - More sophisticated PICs. Still not badly priced at $12 or so, they have much larger memories, and lots of other special features.
  • PIC18F6527/PIC18F8527 - Super massive PICs with tons of I/O, memory and all the peripherals. At $15, these are pricey, and you can't get them in a DIP package. But if you want to do massive I/O, lots of analog inputs, etc. without using external I/O expanders, this is for you. Nearly single cycle access to any I/O pin is really nice for many applications.

No comments: