Author Topic: Pic VS AVR - the differences  (Read 2384 times)

Offline UncleThadius

  • Global Moderator
  • Advanced Poster
  • *****
  • Posts: 41
    • View Profile
Pic VS AVR - the differences
« on: February 07, 2011, 12:14:25 AM »
I started out with a Pic (Basic Stamp) but quickly found that the stamp was overpriced for what you got. Sure it was easy to use and experiment with, but in general it was slow and took learning like anything else. Next stop just like people using the Arduino and Avrstick, etc, was to use the Pic micro directly and solder a common ICSP interface to the board for programming with a serial port programmer.

At this point I could still use Basic to program the Pic micro's but I also found how useful C programming was in terms of speed.  The first project I started was to use the Pic 16F628A for driving a triac for phase control of AC current. I needed to drive three 500 watt lamps (Red, green and blue) independently and in different phases to make a color mix in a pool of water. The 16F628 was easily capable of it when running at 20Mhz but the Picbasic pro left the micro bloated and slow. I ended up building this system on Assembly language which took forever and required lots of help, but in the end I created a commercial product that worked well.

Any AVR micro would have been able to do the same thing and maybe even for a little less price, and probably with a few extra bells and whistles as well. For instance, alot of AVR boards include an on board 32,768 crystal for running a real time clock to keep accurate time. Second, alot of AVR's also have a DAC built in for creating sounds and such directly from the port. Third is that the AVR's include a very wide variety of prescaler values compared to the Pic's. A typical Pic micro has about 3 or 4 prescaler values to choose from for each timer. The AVR usually has double that amount (1, 8, 16, 32, 64, 128, and 256). This is a huge benefit if you have an application that needs different timing values. Fourth is the fact that the AVR has independent PWM channels, where the Pic can run two PWM channels both are tied to the same timer and thus cannot have independent duty cycles for each. Fifth is the fact that for AVR we have a massive community of people that are more willing to help beginners with C programming than you would find with the Pic side of it. Sure there are the Pic forums on the Microchip site, but most of the time my posts have gone unanswered on those forums where as on the forums all of my posts get answered and usually very quickly. Support community is a big concern when you first start out using a certain brand of microcontroller. Sixth is price. Most of the AVR boards and processors are less expensive than the Microchip PIC equivalent and use free tools rather than the purchased C and basic compilers for PIC which can cost hundred of dollars to buy (Picbasic pro is like $149.00 and HiTech C is like $399.00 or something crazy)(Correction: HiTech C Lite for Pic is free with limitations, and Standard is $495.00), Winavr for AVR is free and unlimited.

All in all the AVR is a better choice as long as you are willing to learn a bit of C to program them. If you just want to do very simple things with a micro and need it done quickly with little to no learning required, then Picbasic pro and a 16F or 18F micro is the best choice.....

« Last Edit: February 07, 2011, 12:36:12 AM by UncleThadius »