- Published: Saturday, 09 March 2013
- Written by majenko
- Hits: 23864
People often despair at me for constantly raving on about how great Microchip PIC microcontrollers are, and how much better than everyone else they are.
While I completely agree that each microcontroller has its place in the world, I have yet to find a situation where Microchip don't have a microcontroller which is at least as good as the competition at fulfilling a role, whilst at the same time providing just so much more in the mix as well.
So, I thought I would look at the Arduino UNO's heart and soul, the ATMega328P - a chip that everyone on the Arduino forums thinks is the best micrcontroller, and the only microcontroller you will ever need. I figured I would try and find other microcontrollers from other manufacturers that matched it as closely as possible and compare them - in an objective manner.
After much hunting through product lists from both Microchip and TI I found two suitable matches. The basic criteria:
- Must be in a DIP package.
- Must try and at least match the Flash and RAM specifications. If possible.
I found an admirable match in the Microchip PIC18 range, with the PIC18F25K80 chip - same package as the ATMega328P, with pretty much the same spec. However, TI failed me miserably. So, I have the best I could find in a DIP package from them - the MSP430G2533. A pretty poor comparison that chip, but all I could find.
So, I looked at the basic facilities that each chip provides, and scoring each one on a comparison with the two other chips.
Where there are three different values, red is the worst, yellow is the middle value, and green is the best value. If there are only 2 distinct values, then it's red for the worst, and green for the best. If they're all the same, they're all yellow. Red specifications score 1 point, yellow 2 points, and green 3 points.
A few notes on the findings. Firstly the distinction between RISC and Harvard Architecture. Yes, RISC may be perceived as a faster system than any other. Well, in some senses that is true. Yes, it is fast at performing instructions, as each instruction is very light weight and doesn't take much power to execute. However, you have to execute more of them. Harvard Architecture, however, adds extra efficiency. The instruction set is about as light as RISC (some chips have just 14 instructions), but where a RISC system has a single bus that communicates with everything - flash, RAM, peripherals, etc, the Harvard system has two busses - an instruction bus and a data bus. This means that whilst it is spending time getting instructions from slow flash memory, it can at the same time be getting data from RAM. No waiting for the flash read to finish before you can do the RAM read. That makes a considerable improvement in speed.
Secondly is the use of "shared peripherals". These are where you have a single internal peripheral providing multiple functions, such as the MSSP in the PIC18, which provides both the I²C and SPI interfaces. This means that you can use one or the other but not both.
So anyway, looking at that table, you can clearly see why it is that I think that the ATMega328P is:
- Over priced - It's the most expensive of the three, and while it may not have as poor a specification as the TI offering, it certainly falls below the equivalent (and cheaper) PIC on specifications.
- Under specified - It just doesn't do as much as the PIC. The peripherals are of a lower grade (only 6 channels of 10-bit ADC, compared with 8 channels of 12-bit!), and there just aren't as many of them.
I am sure that, when the Arduino was first conceived that the Atmel chips were cutting edge and the best there were in the price range. Well, the world has moved on, but the Atmel Arduino die-hards are still stuck in the past. They're clinging to the old microcontroller purely because it's the one they've always used, and they seem to have a very blinkered approach to the rest of the microcontroller world. They refuse to even consider the possibility of using a microcontroller that's by anyone other than Atmel.
Horses for courses? Well, the ATMega328P is an old nag that should be minced down and put in a Findus lasagne.