It's a very good question of which chip to use for any project; I don't think there is any one specific answer for every question!
We started off with the ATmega8 just because there were a lot of references on the internet to this chip - what this actually means is that this chip has been around for a long time and people have been writing about it. It doesn't make it the 'best' chip to use!
Having said the above, the ATmega8 does make a very good starter chip
(not least because there is a lot of info on the net). It is also a
very good starter chip because it doesn't have a lot of modern
features!
Because it isn't a 'state of the art' chip, it does mean that it is
well supported by libraries such as
AVR LIB
(library last updated sometime in 2003!). This library makes programming this chip very simple
without having to delve into the depths of how chips actually work. This is good because you can
do a lot of programming without dealing with little details but when you have problems you can
end up totally clueless!
The other extreme is that you forget about 'high' level languages like 'C' and get down to some serious coding in assembler! Personally, we like coding in assembler but the practicalities of programming in such a low level language are painfully slow; but you do get to know how everything works because of the level that you are working at.
As you move onto other chips in the AVR range you will soon start to find the limitations of such libraries as AVRLIB. Because this library isn't up to date, you will find this library doesn't include support for the more modern chips. Even a chip such as the ATmega168 isn't fully supported with this library; with this chip you will suddenly find yourself down at the root level of having to know how AVR chips work and regularly looking up the technical specifications in the relevant PDF datasheets.
So here is our run down of processors we have used:
This is generally a great all round chips; it has 28 pins with 23 of those available for I/O operations (depending on functions used within the chip). This chip is a good all rounder with ADC, general IO, UART, I2C (TWI) interface and SPI comms available. Just to top up the feature points, this chip is fully supported by the AVRLIB routines so everything is just so easy to do.
But, there is always a 'but' to everything good, this is an old chip. When you compare this chip to the ATmega168 you start to see some of the differences. A big part of programming chips is to program with interrupts; with the ATmega168 you can detect changes in line states (pins going low to high or high to low), but this feature is sadly lacking on the ATmega8. What this means is that if you are looking at state changes in a circuit then you will have to continually poll the pins on the ATmega8 whereas on the ATmega168 you can tell the chip to notify you when something changes.
Having said that, this chip runs at about the same maximum speed (16Mhz vs 20Mhz) as the ATmega168 and pin for pin, it's the same as it's more modern counterpart.
If you have read the above about the ATmega8, you should now know where this chip starts to excel when compared to the ATmega8. There is one very big downside to this chip; if you want to start doing anything with timers you will not be able to use the very useful AVRLIB source code - it just isn't supported in the library!
Having said that; come on - do a little bit of learning and timing and counters should be not problem!
This is an excellent chip. When compared to the ATmega8, this chip has multiple interrupts for pin logic levels and has double the memory of the ATmega8 - these two features alone should convince you to go with this chip instead of the rather outdated ATmega8.
In the league of ATmega8/168 chips this little chip just doesn't compare. The poor little ATtiny45 has only got a pin count of 8 compared to the 28 pin count of the ATmega8 and ATmega168.
But sometimes you just need a couple of i/o lines with some custom logic and then this chip really comes into it's own. Obviously, one pin will be taken for VCC and another for Ground but that still leaves a possible 6 IO lines (analogue and digital) - but if you want to keep easy control via a SPI programmer you would lose another pin.
We have not used this chip much in the project (yet), but have played with it a lot! It has a lot of potential for when you only need a few pins of input and output. Although the ATmega8/168 are very good chips, they are quite big with all their 28 pins - this chips small 8 pin package make it ideal for those little jobs.
On top of it's small pin size is a relatively large memory of 4K; comparing it again to the ATmega8/168 (8K and 16K respectively) - it's capable of quite a lot and there are a number of projects on the internet that use this memory with very good effect.
This is a very widely used chip with a number of projects on the internet based on this design. It's a halfway house with a 16 pin count, not as many as the ATmega8/168 but more that the ATtiny45.
One downside to this chip is that it only has 2K of memory which can be a bit limiting when you try to do any extended programming. As a general purpose IO chip, this is just the ticket :)
Maybe this should have been listed up there with the ATmega8/168, but it is a lot more chip than either of those.
This is a 40 pin chip; the physical size of this chip is a lot larger than the ATmega8/168 and it also comes with a 'massive' 32K of memory - Wow!
We are planning to use this chip in our project to be the master of all the other chips and to do the serious calculations within the project.
We haven't used this chip in anger yet :)
This is just a small selection of the chips available from the Atmel range. Which chip is right for your project depends on a lot of factors such as memory requirements, speed and number of inputs and outputs.
We have only given a small view/comparison of the chips that we have had direct contact with, we would like to have to time to investigate a lot more of the AVR range; but unfortunately this is not possible with our budget and time constraints :(