

The ATTINY24 is a low-power 8-bit microcontroller from Atmel's AVR family, designed for small embedded applications. It features 2KB of flash memory, 128 bytes of SRAM, and 16 general-purpose I/O pins. This microcontroller is ideal for projects requiring compact size, low power consumption, and versatile functionality. It supports various communication protocols, including SPI and I²C, making it suitable for a wide range of applications.








| Parameter | Value |
|---|---|
| Architecture | 8-bit AVR |
| Flash Memory | 2KB |
| SRAM | 128 bytes |
| EEPROM | 128 bytes |
| Operating Voltage | 1.8V to 5.5V |
| Clock Speed | Up to 20 MHz (with external crystal) |
| I/O Pins | 16 general-purpose pins |
| Communication Interfaces | SPI, I²C (TWI), USART |
| Timers | Two 8-bit timers, one 16-bit timer |
| ADC | 10-bit ADC with up to 8 channels |
| Power Consumption | <1 µA in power-down mode |
The ATTINY24 is available in a 14-pin PDIP/SOIC package. Below is the pinout and description:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VCC | Power supply (1.8V to 5.5V) |
| 2 | PB0 | General-purpose I/O, ADC0, PCINT0 |
| 3 | PB1 | General-purpose I/O, ADC1, PCINT1 |
| 4 | PB3 | General-purpose I/O, ADC3, PCINT3 |
| 5 | PB2 | General-purpose I/O, ADC2, PCINT2 |
| 6 | PA7 | General-purpose I/O, ADC7, PCINT7 |
| 7 | PA6 | General-purpose I/O, ADC6, PCINT6 |
| 8 | PA5 | General-purpose I/O, ADC5, PCINT5 |
| 9 | PA4 | General-purpose I/O, ADC4, PCINT4 |
| 10 | PA3 | General-purpose I/O, ADC3, PCINT3 |
| 11 | PA2 | General-purpose I/O, ADC2, PCINT2 |
| 12 | PA1 | General-purpose I/O, ADC1, PCINT1 |
| 13 | PA0 | General-purpose I/O, ADC0, PCINT0 |
| 14 | GND | Ground |
Below is an example of how to blink an LED connected to pin PA0 of the ATTINY24. This code can be written in AVR C and uploaded using an ISP programmer.
#include <avr/io.h>
#include <util/delay.h>
#define LED_PIN PA0 // Define the LED pin as PA0
int main(void) {
DDRA |= (1 << LED_PIN); // Set PA0 as an output pin
while (1) {
PORTA |= (1 << LED_PIN); // Turn the LED on
_delay_ms(500); // Wait for 500 milliseconds
PORTA &= ~(1 << LED_PIN); // Turn the LED off
_delay_ms(500); // Wait for 500 milliseconds
}
return 0;
}
Microcontroller Not Responding
Code Upload Fails
I/O Pins Not Working
High Power Consumption
Q: Can the ATTINY24 run without an external crystal?
A: Yes, the ATTINY24 has an internal 8 MHz oscillator that can be used as the clock source.
Q: How do I reset the ATTINY24?
A: The ATTINY24 can be reset by pulling the RESET pin low or by using a watchdog timer reset.
Q: Can I use the ATTINY24 with Arduino IDE?
A: Yes, with the appropriate core files (e.g., ATTinyCore), the ATTINY24 can be programmed using the Arduino IDE.
Q: What is the maximum current per I/O pin?
A: Each I/O pin can source or sink up to 20 mA, but the total current for all pins should not exceed 200 mA.