ATmega164A; ATmega164PA; ATmega324A, ATmega324PA, ATmega644A, ATmega644PA, ATmega1284, ATmega1284P ATmega324 Manual
User Manual:
Open the PDF directly: View PDF
Page Count: 659 [warning: Documents this large are best viewed by clicking the View PDF Link!]
- Features
- 1. Pin configurations
- 2. Overview
- 3. Resources
- 4. About code examples
- 5. Data retention
- 6. Capacitive touch sensing
- 7. AVR CPU Core
- 8. AVR memories
- 9. System clock and clock options
- 9.1 Clock systems and their distribution
- 9.2 Clock Sources
- 9.3 Low Power Crystal Oscillator
- 9.4 Full swing Crystal Oscillator
- 9.5 Low Frequency Crystal Oscillator
- 9.6 Calibrated Internal RC Oscillator
- 9.7 128kHz internal oscillator
- 9.8 External clock
- 9.9 Timer/Counter Oscillator
- 9.10 Clock Output Buffer
- 9.11 System Clock Prescaler
- 9.12 Register description
- 10. Power management and sleep modes
- 11. System Control and Reset
- 12. Interrupts
- 13. External Interrupts
- 13.1 Overview
- 13.2 Register description
- 13.2.1 EICRA – External Interrupt Control Register A
- 13.2.2 EIMSK – External Interrupt Mask Register
- 13.2.3 EIFR –External Interrupt Flag Register
- 13.2.4 PCICR – Pin Change Interrupt Control Register
- 13.2.5 PCIFR – Pin Change Interrupt Flag Register
- 13.2.6 PCMSK3 – Pin Change Mask Register 3
- 13.2.7 PCMSK2 – Pin Change Mask Register 2
- 13.2.8 PCMSK1 – Pin Change Mask Register 1
- 13.2.9 PCMSK0 – Pin Change Mask Register 0
- 14. I/O-Ports
- 14.1 Overview
- 14.2 Ports as General Digital I/O
- 14.3 Alternate Port Functions
- Register description
- 14.3.5 MCUCR – MCU Control Register
- 14.3.6 PORTA – Port A Data Register
- 14.3.7 DDRA – Port A Data Direction Register
- 14.3.8 PINA – Port A Input Pins Address
- 14.3.9 PORTB – Port B Data Register
- 14.3.10 DDRB – Port B Data Direction Register
- 14.3.11 PINB – Port B Input Pins Address
- 14.3.12 PORTC – Port C Data Register
- 14.3.13 DDRC – Port C Data Direction Register
- 14.3.14 PINC – Port C Input Pins Address
- 14.3.15 PORTD – Port D Data Register
- 14.3.16 DDRD – Port D Data Direction Register
- 14.3.17 PIND – Port D Input Pins Address
- 15. 8-bit Timer/Counter0 with PWM
- 15.1 Features
- 15.2 Overview
- 15.3 Timer/Counter Clock Sources
- 15.4 Counter Unit
- 15.5 Output Compare unit
- 15.6 Compare Match Output unit
- 15.7 Modes of operation
- 15.8 Timer/Counter Timing diagrams
- 15.9 Register description
- 15.9.1 TCCR0A – Timer/Counter Control Register A
- 15.9.2 TCCR0B – Timer/Counter Control Register B
- 15.9.3 TCNT0 – Timer/Counter Register
- 15.9.4 OCR0A – Output Compare Register A
- 15.9.5 OCR0B – Output Compare Register B
- 15.9.6 TIMSK0 – Timer/Counter Interrupt Mask Register
- 15.9.7 TIFR0 – Timer/Counter 0 Interrupt Flag Register
- 16. 16-bit Timer/Counter1 and Timer/Counter3(1) with PWM
- 16.1 Features
- 16.2 Overview
- 16.3 Accessing 16-bit Registers
- 16.4 Timer/Counter Clock Sources
- 16.5 Prescaler Reset
- 16.6 Counter Unit
- 16.7 Input Capture Unit
- 16.8 Output Compare units
- 16.9 Compare Match Output unit
- 16.10 Modes of Operation
- 16.11 Timer/Counter Timing diagrams
- 16.12 Register description
- 16.12.1 TCCRnA – Timer/Counter n Control Register A
- 16.12.2 TCCRnB – Timer/Counter n Control Register B
- 16.12.3 TCCRnC – Timer/Counter n Control Register C
- 16.12.4 TCNT1H and TCNT1L –Timer/Counter1
- 16.12.5 TCNT3H and TCNT3L –Timer/Counter3
- 16.12.6 OCR1AH and OCR1AL – Output Compare Register1 A
- 16.12.7 OCR1BH and OCR1BL – Output Compare Register1 B
- 16.12.8 OCR3AH and OCR3AL – Output Compare Register3 A
- 16.12.9 OCR3BH and OCR3BL – Output Compare Register3 B
- 16.12.10 ICR1H and ICR1L – Input Capture Register 1
- 16.12.11 ICR3H and ICR3L – Input Capture Register 3
- 16.12.12 TIMSK1 – Timer/Counter1 Interrupt Mask Register
- 16.12.13 TIMSK3 – Timer/Counter3 Interrupt Mask Register
- 16.12.14 TIFR1 – Timer/Counter1 Interrupt Flag Register
- 16.12.15 TIFR3 – Timer/Counter3 Interrupt Flag Register
- 17. 8-bit Timer/Counter2 with PWM and asynchronous operation
- 17.1 Features
- 17.2 Overview
- 17.3 Timer/Counter clock sources
- 17.4 Counter unit
- 17.5 Output Compare unit
- 17.6 Compare Match Output unit
- 17.7 Modes of operation
- 17.8 Timer/Counter Timing diagrams
- 17.9 Asynchronous Operation of Timer/Counter2
- 17.10 Timer/Counter Prescaler
- 17.11 Register description
- 17.11.1 TCCR2A – Timer/Counter Control Register A
- 17.11.2 TCCR2B – Timer/Counter Control Register B
- 17.11.3 TCNT2 – Timer/Counter Register
- 17.11.4 OCR2A – Output Compare Register A
- 17.11.5 OCR2B – Output Compare Register B
- 17.11.6 ASSR – Asynchronous Status Register
- 17.11.7 TIMSK2 – Timer/Counter2 Interrupt Mask Register
- 17.11.8 TIFR2 – Timer/Counter2 Interrupt Flag Register
- 17.11.9 GTCCR – General Timer/Counter Control Register
- 18. SPI – Serial Peripheral Interface
- 19. USART
- 19.1 Features
- 19.2 USART1 and USART0
- 19.3 Overview
- 19.4 Clock Generation
- 19.5 Frame formats
- 19.6 USART Initialization
- 19.7 Data Transmission – The USART Transmitter
- 19.8 Data Reception – The USART Receiver
- 19.9 Asynchronous Data Reception
- 19.10 Multi-processor Communication mode
- 19.11 Register description
- 19.12 Examples of Baud Rate Setting
- 20. USART in SPI mode
- 21. Two-wire Serial Interface
- 22. AC - Analog Comparator
- 23. ADC - Analog-to-digital converter
- 24. JTAG interface and on-chip debug system
- 25. IEEE 1149.1 (JTAG) Boundary-scan
- 26. Boot loader support – read-while-write self-programming
- 26.1 Features
- 26.2 Overview
- 26.3 Application and Boot Loader Flash Sections
- 26.4 Read-While-Write and No Read-While-Write Flash Sections
- 26.5 Boot Loader Lock Bits
- 26.6 Entering the Boot Loader Program
- 26.7 Addressing the Flash During Self-Programming
- 26.8 Self-Programming the Flash
- 26.8.1 Performing Page Erase by SPM
- 26.8.2 Filling the Temporary Buffer (Page Loading)
- 26.8.3 Performing a Page Write
- 26.8.4 Using the SPM Interrupt
- 26.8.5 Consideration While Updating BLS
- 26.8.6 Prevent Reading the RWW Section During Self-Programming
- 26.8.7 Setting the Boot Loader Lock Bits by SPM
- 26.8.8 EEPROM Write Prevents Writing to SPMCSR
- 26.8.9 Reading the Fuse and Lock Bits from Software
- 26.8.10 Reading the Signature Row from Software
- 26.8.11 Preventing Flash Corruption
- 26.8.12 Programming Time for Flash when Using SPM
- 26.8.13 Simple Assembly Code Example for a Boot Loader
- 26.8.14 Atmel ATmega164A/ATmega164PA Boot Loader Parameters
- 26.8.15 Atmel ATmega324A/ATmega324PA Boot Loader Parameters
- 26.8.16 Atmel ATmega644A/ATmega644PA Boot Loader parameters
- 26.8.17 Atmel ATmega1284/ATmega1284P Boot Loader parameters
- 26.9 Register description
- 27. Memory programming
- 27.1 Program And Data Memory Lock Bits
- 27.2 Fuse bits
- 27.3 Signature Bytes
- 27.4 Calibration byte
- 27.5 Page Size
- 27.6 Parallel Programming Parameters, Pin Mapping, and Commands
- 27.7 Parallel programming
- 27.7.1 Enter Programming mode
- 27.7.2 Considerations for Efficient Programming
- 27.7.3 Chip Erase
- 27.7.4 Programming the Flash
- 27.7.5 Programming the EEPROM
- 27.7.6 Reading the Flash
- 27.7.7 Reading the EEPROM
- 27.7.8 Programming the Fuse Low Bits
- 27.7.9 Programming the Fuse High Bits
- 27.7.10 Programming the Extended Fuse Bits
- 27.7.11 Programming the Lock Bits
- 27.7.12 Reading the Fuse and Lock Bits
- 27.7.13 Reading the Signature Bytes
- 27.7.14 Reading the Calibration Byte
- 27.7.15 Parallel Programming Characteristics
- 27.8 Serial downloading
- 27.9 Serial Programming Instruction set
- 27.10 Programming via the JTAG Interface
- 27.10.1 Programming Specific JTAG Instructions
- 27.10.2 AVR_RESET (0xC)
- 27.10.3 PROG_ENABLE (0x4)
- 27.10.4 PROG_COMMANDS (0x5)
- 27.10.5 PROG_PAGELOAD (0x6)
- 27.10.6 PROG_PAGEREAD (0x7)
- 27.10.7 Data Registers
- 27.10.8 Reset Register
- 27.10.9 Programming Enable Register
- 27.10.10 Programming Command Register
- 27.10.11 Flash Data Byte Register
- 27.10.12 Programming Algorithm
- 27.10.13 Entering Programming Mode
- 27.10.14 Leaving Programming Mode
- 27.10.15 Performing Chip Erase
- 27.10.16 Programming the Flash
- 27.10.17 Reading the Flash
- 27.10.18 Programming the EEPROM
- 27.10.19 Reading the EEPROM
- 27.10.20 Programming the Fuses
- 27.10.21 Programming the Lock Bits
- 27.10.22 Reading the Fuses and Lock Bits
- 27.10.23 Reading the Signature Bytes
- 27.10.24 Reading the Calibration Byte
- 28. Electrical characteristics (TA = -40°C to 85°C)
- 28.1 DC Characteristics
- 28.1.1 Atmel ATmega164A DC characteristics
- 28.1.2 Atmel ATmega164PA DC characteristics
- 28.1.3 Atmel ATmega324A DC characteristics
- 28.1.4 Atmel ATmega324PA DC characteristics
- 28.1.5 Atmel ATmega644A DC characteristics
- 28.1.6 Atmel ATmega644PA DC characteristics
- 28.1.7 Atmel ATmega1284 DC characteristics
- 28.1.8 Atmel ATmega1284P DC characteristics
- 28.2 Speed grades
- 28.3 Clock characteristics
- 28.4 System and reset characteristics
- 28.5 External interrupts characteristics
- 28.6 SPI timing characteristics
- 28.7 Two-wire Serial Interface Characteristics
- 28.8 ADC characteristics
- 28.1 DC Characteristics
- 29. Electrical Characteristics - TA = -40°C to 105°C
- 30. Typical characteristics -TA = -40°C to 85°C
- 30.1 Atmel ATmega164A typical characteristics - TA = -40°C to 85°C
- 30.1.1 Active supply current
- 30.1.2 Idle supply current
- 30.1.3 Supply current of I/O modules
- 30.1.4 Power-down supply current
- 30.1.5 Power-save supply current
- 30.1.6 Standby supply current
- 30.1.7 Pin pull-up
- 30.1.8 Pin driver strength
- 30.1.9 Pin threshold and hysteresis
- 30.1.10 BOD threshold
- 30.1.11 Internal oscillator speed
- 30.1.12 Current consumption of peripheral units
- 30.1.13 Current consumption in reset and reset pulsewidth
- 30.2 Atmel ATmega164PA typical characteristics - TA = -40°C to 85°C
- 30.2.1 Active supply current
- 30.2.2 Idle supply current
- 30.2.3 Supply current of I/O modules
- 30.2.4 Power-down supply current
- 30.2.5 Power-save supply current
- 30.2.6 Standby supply current
- 30.2.7 Pin pull-up
- 30.2.8 Pin driver strength
- 30.2.9 Pin threshold and hysteresis
- 30.2.10 BOD threshold
- 30.2.11 Internal oscillator speed
- 30.2.12 Current consumption of peripheral units
- 30.2.13 Current consumption in reset and reset pulsewidth
- 30.3 Atmel ATmega324A typical characteristics - TA = -40°C to 85°C
- 30.3.1 Active supply current
- 30.3.2 Idle supply current
- 30.3.3 Supply current of I/O modules
- 30.3.4 Power-down supply current
- 30.3.5 Power-save supply current
- 30.3.6 Standby supply current
- 30.3.7 Pin pull-up
- 30.3.8 Pin driver strength
- 30.3.9 Pin threshold and hysteresis
- 30.3.10 BOD threshold
- 30.3.11 Internal oscillator speed
- 30.3.12 Current consumption of peripheral units
- 30.3.13 Current consumption in reset and reset pulsewidth
- 30.4 Atmel ATmega324PA typical characteristics - TA = -40°C to 85°C
- 30.4.1 Active supply current
- 30.4.2 Idle supply current
- 30.4.3 Supply current of I/O modules
- 30.4.4 Power-down Supply Current
- 30.4.5 Power-save supply current
- 30.4.6 Standby supply current
- 30.4.7 Pin pull-up
- 30.4.8 Pin driver strength
- 30.4.9 Pin threshold and hysteresis
- 30.4.10 BOD threshold
- 30.4.11 Internal oscillator speed
- 30.4.12 Current consumption of peripheral units
- 30.4.13 Current consumption in reset and reset pulsewidth
- 30.5 Atmel ATmega644A typical characteristics - TA = -40°C to 85°C
- 30.5.1 Active supply current
- 30.5.2 Idle supply current
- 30.5.3 Supply current of I/O modules
- 30.5.4 Power-down supply current
- 30.5.5 Power-save supply current
- 30.5.6 Standby supply current
- 30.5.7 Pin pull-up
- 30.5.8 Pin driver strength
- 30.5.9 Pin threshold and hysteresis
- 30.5.10 BOD threshold
- 30.5.11 Internal oscillator speed
- 30.5.12 Current consumption of peripheral units
- 30.5.13 Current consumption in reset and reset pulsewidth
- 30.6 ATmega644PA typical characteristics - TA = -40°C to 85°C
- 30.6.1 Active supply current
- 30.6.2 Idle supply current
- 30.6.3 Supply current of I/O modules
- 30.6.4 Power-down supply current
- 30.6.5 Power-save supply current
- 30.6.6 Standby supply current
- 30.6.7 Pin pull-up
- 30.6.8 Pin driver strength
- 30.6.9 Pin threshold and hysteresis
- 30.6.10 BOD threshold
- 30.6.11 Internal oscillator speed
- 30.6.12 Current consumption of peripheral units
- 30.6.13 Current consumption in reset and reset pulsewidth
- 30.7 ATmega1284 typical characteristics - TA = -40°C to 85°C
- 30.7.1 Active supply current
- 30.7.2 Idle supply current
- 30.7.3 Supply current of I/O modules
- 30.7.4 Power-down supply current
- 30.7.5 Power-save supply current
- 30.7.6 Standby supply current
- 30.7.7 Pin pull-up
- 30.7.8 Pin driver strength
- 30.7.9 Pin threshold and hysteresis
- 30.7.10 BOD threshold
- 30.7.11 Internal oscillator speed
- 30.7.12 Current consumption of peripheral units
- 30.7.13 Current consumption in reset and reset pulsewidth
- 30.8 ATmega1284P typical characteristics - TA = -40°C to 85°C
- 30.8.1 Active supply current
- 30.8.2 Idle supply current
- 30.8.3 Supply current of I/O modules
- 30.8.4 Power-down supply current
- 30.8.5 Power-save supply current
- 30.8.6 Standby supply current
- 30.8.7 Pin pull-up
- 30.8.8 Pin driver strength
- 30.8.9 Pin threshold and hysteresis
- 30.8.10 BOD threshold
- 30.8.11 Internal oscillator speed
- 30.8.12 Current consumption of peripheral units
- 30.8.13 Current consumption in reset and reset pulsewidth
- 30.1 Atmel ATmega164A typical characteristics - TA = -40°C to 85°C
- 31. Typical Characteristics - TA = -40°C to 105°C
- 31.1 ATmega164PA Typical Characteristics - TA = -40°C to 105°C
- 31.1.1 Active supply current
- 31.1.2 Idle supply current
- 31.1.3 Power-down supply current
- 31.1.4 Pin pull-up
- 31.1.5 Pin driver strength
- 31.1.6 Pin threshold and hysteresis
- 31.1.7 BOD threshold
- 31.1.8 Internal oscillator speed
- 31.1.9 Current consumption of peripheral units
- 31.1.10 Current consumption in reset and reset pulsewidth
- 31.2 ATmega324PA Typical Characteristics - TA = -40°C to 105°C
- 31.2.1 Active Supply Current
- 31.2.2 Idle Supply Current
- 31.2.3 Power-down Supply Current
- 31.2.4 Pin Pull-up
- 31.2.5 Pin Driver Strength
- 31.2.6 Pin Threshold and Hysteresis
- 31.2.7 BOD Threshold
- 31.2.8 Internal Oscillator Speed
- 31.2.9 Current Consumption of Peripheral Units
- 31.2.10 Current Consumption in Reset and Reset Pulsewidth
- 31.3 ATmega644PA Typical Characteristics - TA = -40°C to 105°C
- 31.3.1 Active Supply Current
- 31.3.2 Idle Supply Current
- 31.3.3 Power-down Supply Current
- 31.3.4 Pin Pull-up
- 31.3.5 Pin Driver Strength
- 31.3.6 Pin Threshold and Hysteresis
- 31.3.7 BOD Threshold
- 31.3.8 Internal Oscillator Speed
- 31.3.9 Current Consumption of Peripheral Units
- 31.3.10 Current Consumption in Reset and Reset Pulsewidth
- 31.4 ATmega1284P typical characteristics - TA = -40°C to 105°C
- 31.4.1 Active supply current
- 31.4.2 Idle supply current
- 31.4.3 Power-down supply current
- 31.4.4 Power-save supply current
- 31.4.5 Pin pull-up
- 31.4.6 Pin driver strength
- 31.4.7 Pin threshold and hysteresis
- 31.4.8 BOD threshold
- 31.4.9 Internal oscillator speed
- 31.4.10 Current consumption of peripheral units
- 31.4.11 Current consumption in reset and reset pulsewidth
- 31.1 ATmega164PA Typical Characteristics - TA = -40°C to 105°C
- 32. Register summary
- 33. Instruction set summary
- 34. Ordering information
- 35. Packaging information
- 36. Errata
- 37. Datasheet revision history