PDA

View Full Version : Recommended PIC for hobby (and beginner) apps?



rmteo
- 29th August 2008, 05:54
My recommendation is a 28-pin PIC24FJxxGA002 (or one of the larger members of this family) for hobby applications. These are my reasons:

1. COST - A 28-pin PIC24FJ32GA002 with 32kB FLASH and 8kB RAM cost about $3 in single quantities and is available in a DIP package. An equivalent 12, 14 or 16 bit core device (PIC12/16/18) may cost a little less but for hobby applications this is of no consequence.
2. EASE OF USE - At the LED blinky level, they are no more difficult to use than the smaller devices. However, when you get beyond this stage, I feel that they are actually easier to use (whether you program in ASM or a higher level compiler). Some reasons:
a. the entire 8kB of RAM is addressed linearly - no bank switching, etc.
b. vectored interrupts.
c. You can address up to 4MB of program address space - again with no banking.

3. POWER & FLEXIBILITY - There are many features not available in smaller PIC's
a. Up to 16MIPS - this can be achieved with a 32MHz clock using just the internal oscillator.
b. 17x17 hardware multiplier - performs 16x16 signed and unsigned multiplication in a single instruction cycle. Also, it has a hardware assisted 32x16 divider that will do the division in 19 instruction cycles. Compare this with the several hundred cycles required by the smaller PIC's.
c. 18mA/18mA Sink/Source on all I/O pins. Not quite as high as the typical 25/25 on the smaller PIC's but still suitable for driving LED's directly.
d. 10-bit A/D, 500ksps sample rate - 5x the speed of the smaller PIC's.
e. Many useful peripherals built-in - 2x UART (with built-in IrDA support), 5x timers (16-bit and/or 32-bit), 5x independent input capture, 5x independent output compare/PWM, 2x SPI (3 and 4 wire mode), 2x I2C (independent master & slave logic), hardware RTCC with clock, calendar and alarm functions.
f. Up to 118 interrupt vectors.
g. They have a feature called PPS (Peripheral Pin Select) where you can assign most of the digital peripherals (UART, SPI, PWM, etc.) to just about any pin you want. For example, you can assign UART TX to RB0 and UART RX to RB5. You can even change these assignments in your code during run-time.

There are 2 downsides to these devices that I can see:
1. They only operate at 3.3V. However, all digital I/O have independently configurable open-drain outputs for interfacing to 5V logic using a pull-up resistor.
2. They do not have EEPROM. Since you can read/write to program memory under software control, you can use as much of it as you want for storing non-volatile data.

My use for the smaller devices (PIC12/16/18) is in high-volume production applications where you absolutely have to keep the per-part cost down to the barest minimum. Then you pick the cheapest part that will do the job and program in ASM so that it requires the least amount of resources to do its thing.