Extended list of 8-bit AVR Micro-Controllers, easily programmable with the Arduino IDE

A couple days back, I wrote about ‘The $3 Arduino‘, how to leave the Arduino board behind and program an ATmega168 Micro-Controller directly, still using the Arduino IDE but with the AVRMSPII programmer. Of course, the ATmega168 isn’t the only MC available for something like that. In fact, I have quite a few 8-bit AVR Micro-Controllers in a small box right here, next to my desk.
Let’s minimize the ‘Minimal Arduino’ even more, for instance by using the tiny ATtiny85 Microcontroller. Just like we did with the ‘BareBones’ definition, we add board definitions for the Mircocontrollers that the Arduino IDE doesn’t support out-of-the-box. Board definition for the missing MCs can be found here and after moving the attiny folder into the ~/Document/Arduino/hardware folder and restartig the Arduino IDE, the IDE should now know about the new MCs. More details about this can be read here.

Minimizing the Minimal Arduino

Now that the Arduino IDE knows about the really tiny ATtiny85, we can set it’s internal clock to 8Mhz and flash a small program.

To flash the chip, we use the SPI (MOSI/MISO/SCK) Pins like shown here:

  1. RSET -> ATtiny85-Pin 1
  2. GND -> ATtiny85-Pin 4
  3. MOSI -> ATtiny85-Pin 5
  4. MISO -> ATtiny85-Pin 6
  5. SCK -> ATtiny85-Pin 7
  6. +5V -> ATtiny85-Pin 8

Switching the Internal Clock to 8MHz

Using the Fuse Calculator we can find the proper ATtiny85 fuse settings, to use the internal RC Oscillator and setting it to 8Mhz.
The avrdude arguments look something like this: -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
Avrdude is one of the tools that the Arduino IDE deploys on your computer. You can either execute Avrdude with those arguments directly, like so:

avrdude -p t85 -b 115200 -P usb -c avrispmkII -V -e -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m

or just execute the ‘Burn Bootloader’ command in the Arduino IDE’s Tools menu.
While this will NOT burn a bootloader on the ATtiny85 chip, it will set the fuses appropriately. Either way, this step needs to be performed only once.

With the microcontroller still connected to the AT-AVR-ISP2 programmer, a simple program can be quickly uploaded:

int p = 3;                // LED connected to digital pin 13
void setup() {
  pinMode(p, OUTPUT);      // sets the digital pin as output
}
 
void loop() {
  digitalWrite(p, HIGH);   // sets the LED on
  delay(100);              // .. for 10th of a sec
  digitalWrite(p, LOW);    // sets the LED off again
  delay(1000);             //  waits for a second
  digitalWrite(p, HIGH);   // sets the LED on
  delay(500);              // .. for 1/2 a sec
  digitalWrite(p, LOW);    // sets the LED off again
  delay(500);              // .. for 1/2 a second
}

ATtiny2313 ($2.00)

The high-performance, low-power Atmel 8-bit AVR RISC-based microcontroller combines 2KB ISP flash memory, 128B ISP EEPROM, 128B internal SRAM, universal serial interface (USI), full duplex UART, and debugWIRE for on-chip debugging. The device supports a throughput of 20 MIPS at 20 MHz and operates between 2.7-5.5 volts.
By executing powerful instructions in a single clock cycle, the device achieves throughputs approaching 1 MIPS per MHz, balancing power consumption and processing speed.

ATtiny84 ($3.00)

The high-performance, low-power Atmel 8-bit AVR RISC-based microcontroller combines 8KB ISP flash memory, 512B EEPROM, 512-Byte SRAM, 12 general purpose I/O lines, 32 general purpose working registers, an 2 timers/counters (8-bit/16-bit) with two PWM channels each, internal and external interrupts, 8-channel 10-bit A/D converter, programmable gain stage (1x, 20x) for 12 differential ADC channel pairs, programmable watchdog timer with internal oscillator, internal calibrated oscillator, and four software selectable power saving modes.

ATtiny85 ($1.00)

The high-performance, low-power Atmel 8-bit AVR RISC-based microcontroller combines 8KB ISP flash memory, 512B EEPROM, 512-Byte SRAM, 6 general purpose I/O lines, 32 general purpose working registers, one 8-bit timer/counter with compare modes, one 8-bit high speed timer/counter, USI, internal and external Interrupts, 4-channel 10-bit A/D converter, programmable watchdog timer with internal oscillator, three software selectable power saving modes, and debugWIRE for on-chip debugging. The device achieves a throughput of 20 MIPS at 20 MHz and operates between 2.7-5.5 volts.

ATmega8 ($2.00)

The low-power Atmel 8-bit AVR RISC-based microcontroller combines 8KB of programmable flash memory, 1KB of SRAM, 512K EEPROM, and a 6 or 8 channel 10-bit A/D converter. The device supports throughput of 16 MIPS at 16 MHz and operates between 2.7-5.5 volts.

ATmega168 ($4.00)

The high-performance, low-power Atmel 8-bit AVR RISC-based microcontroller combines 16KB ISP flash memory, 1KB SRAM, 512B EEPROM, an 8-channel/10-bit A/D converter (TQFP and QFN/MLF), and debugWIRE for on-chip debugging. The device supports a throughput of 20 MIPS at 20 MHz and operates between 2.7-5.5 volts.

ATmeaga328 ($5.00)

The high-performance Atmel 8-bit AVR RISC-based microcontroller combines 32KB ISP flash memory with read-while-write capabilities, 1KB EEPROM, 2KB SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, a byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D converter (8-channels in TQFP and QFN/MLF packages), programmable watchdog timer with internal oscillator, and five software selectable power saving modes. The device operates between 1.8-5.5 volts.

MC Flash (KB) SRAM (Bytes) EEPROM (Byte) SPI I2C UART ADC Chnnl (10bit) PWM Chnnl Timer RTC
ATtiny2312 2 128 128 2 1 1 4 2 No
ATtiny84 8 512 512 1 1 0 8 4 2 No
ATtiny85 8 512 512 1 1 0 4 6 2 No
ATmega8 8 1024 512 1 1 1 8 3 3 Yes
ATmega168 16 1024 512 2 1 1 8 6 3 Yes
ATmega328 32 2048 1024 2 1 1 8 6 3 Yes

 

Leave a Reply