AVR pageThis page is dedicated to Atmels AVR family of CPUs.
These CPUs feature 1 MIPS per MHz, and have a Flash which makes them incircuit (re-)programmable.
Unlike some competitors they have a straight forward register- and instructionset.
I"m currently using the
- AT90S1200 - 1k Flash, 0 RAM, 64 EEPROM, Timer, PDIP20
- AT90S2313 - 2k Flash, 128 RAM, 128 EEPROM, Timers, UART, PDIP20
- AT90LS8535 - 8k Flash, 512RAM, 512 EEPROM, 8*10bit ADC, Timers, UART, TQFP44
- ATMEGA163L - 16k Flash, 512RAM, 512 EEPROM, 8*10bit ADC, Timers, UART, bootcode flash, TQFP44
- ATMEGA323 - 32k Flash, 2kRAM, 1k EEPROM, 8*10bit ADC, Timers, UART, bootcode flash, JTAG, TQFP44
- ATMEGA32 - 32k Flash, 2kRAM, 1k EEPROM, 8*10bit ADC, Timers, UART, bootcode flash, JTAG, TQFP44
- ATMEGA128 - 128k Flash, 4k RAM, 4k EEPROM, optional 64k external adress space, 8*10bit ADC, 2 8bit timer, 2 16 bit timer, TWI, 2 UART, bootcode flash, JTAG, 6 PWM, TQFP64
- ATTiny26 - 2k Flash, 128byte RAM, 128byte EEPROM, 8bit timer, 8bit fast timer, 11*10bit ADC, USI, SO20
ASMThe Atmel AVRASM is a standard to work with. Complete with MDI GUI.
Downloadable for free on the Atmel site
- usable ASM macros
- small stuff
- a menu on an LCD
- controlling a 4x20 LCD
- FSK sinus modulator
- Turbo strings
- using the EEPROM
- Timer and UART interrupt
- Calibrating the internal RC oscillator with the 32kHz quartz
- the WAVRASM and the IAR ASM are told to be not compatible what the LPM instruction concerns
IAR CThe IAR C Compiler is rather complicated to work with and rather expensive, in the order of
3000 CHFr, 1800 $US. Comes with Dongle. Their email support is responsive, unfortunately there
is no newsgroup.
Imagecraft AVR C CompilerImagecraft Their C Compiler is simpler to operate than the IAR and cheaper. In the order of 250$US.
There is a 30 day trial version. No dongle, but a code that has to be requested at Imagecraft.
The email support is responsive. A listserver is available, but no newsgroup. Yearly support is 30$.
- code is coming soon
E-LAB Pascal CompilerE-Lab It took a while until I found this pascal compiler. It comes with a programmer plus a whealth of functions and libraries. A wizard configures a new project with a few clicks. Eg Multitasking is just a click. The first and only compiler I know of that treats EEPROM same a RAM. Even blockmoves to and from the EEPROM are supported. Support is responsive, plus a (slow) http forum is available. The standard version is approx 480Euro, the pro version is 940Euro.
- The PED32 Application wizard
- Using the timer interrupt as tick in AVRCo
- The ADC interrupt in AVRCo
- The UART interrupt in AVRCo
- Interfacing with Atmel Dataflash
Migrating from the 8535 to the Mega163These two CPUs are almost identical, except for these differences :
- Double Flash 16k, double SRAM 1k
- hardware multiplier
- Boot code
- internal RC oscillator
- one more PWM makes 2
- one more sleep modes makes 4
- special option fuses for clock
Migrating from the Mega163 to the Mega323These two CPUs are almost identical, except for these differences :
- Double Flash 32k, double SRAM 2k, double EEPROM 1k
- JTAG port
- RTC has additional counter mode
- one more PWM makes 4
- two more sleep modes make 6
- two more interrupts
- special option fuses for clock and such. see page 27 & 182
- The 323 requires the new clock selection fuses to be set. If set to external clock,
there has to be an external clock, otherwise nothing will work anymore. The serial
programming also won"t work anymore. Attaching an external oscillator helps. Fortunately
there is no clock option NONE. Note that while the manual talks about 0 and 1"s to be
written there, the programmer software might talk about programmed=0 and unprogrammed=1
- There are 2 more interrupts, compare page 20 &21 of the 163 manual with pages 22 .. 24 of
the 323 manual. This means some interrupts vectors are shifted by one or two.
- When replacing the definition files for the registers, note that some registers changed
their name : GIMSK became GICR and such.
- The special option fuses require close attention when it comes to the JTAGEN,
programmed by default, part of the PortC behaves unexpected. When just migrating,
set it to unprogrammed and it behaves as PortC is expected
Migrating from the Mega323 to the Mega32Again almost identical, except for these differences :
- new ADC modes, incl. programmable gain
The Mega32 fuses in summary here
Migrating to the Mega128Aahh, finally a CPU with sufficient code space. Yet it is not perfect. The JTAG
port is on top of the ADC and the SPI programming requires a tristate buffer.
As I till now couldn"t refrain from using the internal ADC, I wasn"t able to have
a look at the JTAG and its capabilities.
The Mega128 fuses in summary here
A cheap solution for many problems, the Tiny26In a space saving SO20 case comes the Tiny 26. For just 0.90 Euro, it is a bargain.
The fuses are summarized here
The programming adaptersThere are multiple pinouts on different connectors for SPI programming adapters.
|SPI pinout 1||SPI pinout 2|
|destroys something when rotated||rotation safe|
The JTAG connectors appear to be 10 pin flat ribbon cable plugs.
|JTAG pinout 1||JTAG pinout 2|
|E-Lab||Altera (CPLD & FPGA)|
Other issues of interest
- Considering lowpower ? A recent project I was involved taught me a bit.
- Finally after years of dreaming about, some thoughs on a bootloader
- Quartz and baudrates are discussed here
last updated subpage: 17.feb.07, or perhaps later