Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use ATTINY84A: Examples, Pinouts, and Specs

Image of ATTINY84ADesign with ATTINY84A in Cirkit Designer

Introduction

The ATTINY84A is a low-power 8-bit microcontroller from Atmel's AVR family, designed for compact and efficient embedded applications. With its 14-pin configuration, 8KB of flash memory, and versatile peripherals, the ATTINY84A is ideal for projects requiring a small footprint and low power consumption. It supports a wide range of functionalities, including timers, analog-to-digital conversion (ADC), and pulse-width modulation (PWM).

Explore Projects Built with ATTINY84A

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of ATtiny85 and OLED Display Based Interactive Game with Buzzer and LED: A project utilizing ATTINY84A in a practical application
ATtiny85 and OLED Display Based Interactive Game with Buzzer and LED

This circuit is a simple interactive game system powered by a 5V battery, featuring an ATtiny85 microcontroller, an OLED display, a buzzer, an LED, and multiple pushbuttons. The OLED displays a menu with options to start a game, which is controlled by the ATtiny85. The buzzer and LED provide audio-visual feedback, and the pushbuttons are used for user input to navigate the menu and play the game.

Open Project in Cirkit Designer
Image of ATtiny-Controlled LED Blinker Circuit: A project utilizing ATTINY84A in a practical application
ATtiny-Controlled LED Blinker Circuit

This circuit consists of an ATtiny microcontroller that controls an LED through one of its GPIO pins (PB4). A resistor is connected in series with the LED to limit the current. The ATtiny is powered by a 3.3V battery, and the LED is designed to turn on when the ATtiny is powered up.

Open Project in Cirkit Designer
Image of ATmega328P-Based Sensor Hub with OLED Display and LIDAR: A project utilizing ATTINY84A in a practical application
ATmega328P-Based Sensor Hub with OLED Display and LIDAR

This circuit features an Mtiny Uno ATmega328P microcontroller as its central processing unit, interfacing with a variety of sensors and peripherals. It includes a 0.96" OLED display and an MPU6050 accelerometer/gyroscope for user interface and motion sensing, respectively. The circuit also integrates a TF LUNA LIDAR for distance measurement, a DHT11 sensor for temperature and humidity readings, and uses a 9V battery with a 7805 voltage regulator for power management. Communication with a computer for programming and data exchange is facilitated by an Adafruit FTDI Friend module.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

Key Technical Details

Parameter Value
Manufacturer Atmel
Part Number ATTINY84A-SSFR
Architecture AVR 8-bit
Flash Memory 8KB
SRAM 512 bytes
EEPROM 512 bytes
Operating Voltage 1.8V to 5.5V
Maximum Clock Speed 20 MHz
I/O Pins 6 (configurable as digital or analog)
ADC Resolution 10-bit
Timers 2 (8-bit and 16-bit)
PWM Channels 4
Communication Interfaces SPI, I²C, and USART
Package Type SOIC-14

Pin Configuration and Descriptions

The ATTINY84A has 14 pins, each with specific functions. Below is the pinout description:

Pin Number Pin Name Description
1 VCC Power supply (1.8V to 5.5V)
2 PB0 Digital I/O, ADC input, PWM output
3 PB1 Digital I/O, ADC input, PWM output
4 PB3 Digital I/O, ADC input, PWM output
5 PB2 Digital I/O, ADC input, PWM output
6 PA7 Digital I/O, ADC input
7 PA6 Digital I/O, ADC input
8 PA5 Digital I/O, ADC input
9 PA4 Digital I/O, ADC input
10 PA3 Digital I/O, ADC input
11 PA2 Digital I/O, ADC input
12 PA1 Digital I/O, ADC input
13 PA0 Digital I/O, ADC input
14 GND Ground

Usage Instructions

How to Use the ATTINY84A in a Circuit

  1. Power Supply: Connect the VCC pin to a power source (1.8V to 5.5V) and the GND pin to ground.
  2. Programming: Use an AVR programmer or an Arduino as an ISP (In-System Programmer) to upload code to the ATTINY84A.
  3. I/O Configuration: Configure the I/O pins as digital or analog inputs/outputs in your code.
  4. Peripherals: Utilize the built-in peripherals such as ADC, timers, and PWM for your application.
  5. Communication: Use SPI, I²C, or USART for interfacing with other devices.

Important Considerations and Best Practices

Example: Using ATTINY84A with Arduino UNO as ISP

Below is an example of programming the ATTINY84A using an Arduino UNO as an ISP:

Arduino UNO as ISP Setup

  1. Connect the Arduino UNO to your computer and upload the "ArduinoISP" sketch from the Arduino IDE.
  2. Wire the ATTINY84A to the Arduino UNO as follows:
    • ATTINY84A Pin 1 (VCC) → Arduino 5V
    • ATTINY84A Pin 14 (GND) → Arduino GND
    • ATTINY84A Pin 4 (PB2) → Arduino Pin 10 (SS)
    • ATTINY84A Pin 7 (PA6) → Arduino Pin 11 (MOSI)
    • ATTINY84A Pin 8 (PA4) → Arduino Pin 12 (MISO)
    • ATTINY84A Pin 9 (PA3) → Arduino Pin 13 (SCK)

Example Code

// Blink an LED connected to PB0 (Pin 2 on ATTINY84A)

// Define the LED pin
#define LED_PIN 0  // PB0 corresponds to digital pin 0 on ATTINY84A

void setup() {
  pinMode(LED_PIN, OUTPUT);  // Set PB0 as an output pin
}

void loop() {
  digitalWrite(LED_PIN, HIGH);  // Turn the LED on
  delay(500);                  // Wait for 500 milliseconds
  digitalWrite(LED_PIN, LOW);   // Turn the LED off
  delay(500);                  // Wait for 500 milliseconds
}

To upload the code:

  1. Select "ATTINY84A" as the board in the Arduino IDE.
  2. Choose the appropriate clock frequency (e.g., 8 MHz internal).
  3. Select "Arduino as ISP" as the programmer.
  4. Upload the sketch.

Troubleshooting and FAQs

Common Issues

  1. The ATTINY84A is not responding to programming commands.

    • Solution: Ensure the wiring between the programmer and the ATTINY84A is correct. Check for loose connections.
    • Tip: Verify that the correct board and clock settings are selected in the Arduino IDE.
  2. The microcontroller is not running the uploaded code.

    • Solution: Check the power supply voltage and ensure it is within the operating range (1.8V to 5.5V).
    • Tip: Confirm that the fuses are set correctly for the desired clock source.
  3. Analog readings are unstable.

    • Solution: Add a decoupling capacitor (e.g., 0.1µF) near the VCC and GND pins.
    • Tip: Use an external reference voltage for the ADC if higher precision is required.
  4. PWM output is not working as expected.

    • Solution: Verify that the correct timer and pin are configured for PWM in the code.
    • Tip: Check the datasheet for the specific timer and pin mappings.

FAQs

This concludes the documentation for the ATTINY84A. For further details, refer to the official datasheet provided by Atmel.