Block diagram and pin diagram of ATmega328

 

Introduction to ATmega328


ATmega328. ATmega328 is an Advanced Virtual RISC (AVR) microcontroller. It supports 8-bit data processing. ATmega-328 has 32KB internal flash memory.


ATmega328 has 1KB Electrically Erasable Programmable Read-Only Memory (EEPROM). This property shows if the electric supply supplied to the micro-controller is removed, even then it can store the data and can provide results after providing it with the electric supply. Moreover, ATmega-328 has 2KB Static Random Access Memory (SRAM). Other characteristics will be explained later. ATmega 328 has several different features which make it the most popular device in today's market. These features consist of advanced RISC architecture, good performance, low power consumption, real timer counter having separate oscillator, 6 PWM pins, programmable Serial USART, programming lock for software security, throughput up to 20 MIPS etc. Further details about ATmega 328 will be given later in this section.

  • ATmega328 is an 8-bit, 28-Pin AVR Microcontroller, manufactured by Microchip, follows RISC Architecture and has a flash-type program memory of 32KB.
  • Atmega328 is the microcontroller, used in basic Arduino boards i.e Arduino UNO, Arduino Pro Mini and Arduino Nano.
  • It has an EEPROM memory of 1KB and its SRAM memory is 2KB.
  • It has 8 Pins for ADC operations, which all combine to form PortA ( PA0 - PA7 ).
  • It also has 3 built-in Timers, two of them are 8 Bit timers while the third one is 16-Bit Timer.
  • You must have heard of Arduino UNO, UNO is based on atmega328 Microcontroller. It's UNO's heart. :)
  • It operates ranging from 3.3V to 5.5V but normally we use 5V as a standard.
  • Its excellent features include cost-efficiency, low power dissipation, programming lock for security purposes, real timer counter with separate oscillator.

  • The following table shows the complete features of ATmega328:
    • ATmega328 Features
      No. of Pins28
      CPURISC 8-Bit AVR
      Operating Voltage1.8 to 5.5 V
      Program Memory32KB
      Program Memory TypeFlash
      SRAM2048 Bytes
      EEPROM1024 Bytes
      ADC10-Bit
      Number of ADC Channels8
      PWM Pins6
      Comparator1
      Packages (4)8-pin PDIP 32-lead TQFP 28-pad QFN/MLF 32-pad QFN/MLF
      Oscillatorup to 20 MHz
      Timer (3)8-Bit x 2 & 16-Bit x 1
      Enhanced Power-on ResetYes
      Power Up TimerYes
      I/O Pins23
      ManufacturerMicrochip
      SPIYes
      I2CYes
      Watchdog TimerYes
      Brownout detect (BOD)Yes
      ResetYes
      USI (Universal Serial Interface)Yes
      Minimum Operating Temperature-40 C to +85 C


      ATmega328 Pins



      • ATmega-328 is an AVR Microcontroller having twenty-eight (28) pins in total.
      • Through the pinout diagram, we can understand the configurations of the pins of any electronic device, so you are working on any Engineering Project then you must first read the components' pinout.

      ATmega328 Pins Description


      • Functions associated with the pins must be known in order to use the device appropriately.
      • ATmega-328 pins are divided into different ports which are given in detail below.

      1. VCC is a digital voltage supply.
      2. AVCC is a supply voltage pin for analog to digital converter.
      3. GND denotes Ground and it has a 0V.Port A consists of the pins from PA0 to PA7. These pins serve as an analog input to analog to digital converters. If analog to digital converter is not used, port acts as an eight (8) bit bidirectional input/output port.
      4. Port B consists of the pins from PB0 to PB7. This port is an 8 bit bidirectional port having an internal pull-up resistor.
      5. Port C consists of the pins from PC0 to PC7. The output buffers of port C has symmetrical drive characteristics with source capability as well high sink.
      6. Port D consists of the pins from PD0 to PD7. It is also an 8 bit input/output port having an internal pull-up resistor.
      7. AREF is an analog reference pin for analog to digital converter.


      ATmega328 Block Diagram




      • The Block diagram shows the internal circuitry and the flow of the program of any device.
      • ATmega 328 block diagram is shown in the figure given above.
      • ATmega328 Memory

        • ATmega 328 has three types of memories, named:
          • Flash Memory: 32KB. It is a Programmable Read-Only Memory (ROM). It is a nonvolatile memory.
          • SRAM: 2KB. Stands for Static Random Access Memory. It is a volatile memory i.e. data will be removed after removing the power supply.
          • EEPROM: 1KB. Stands for Electrically Erasable Programmable Read-Only Memory.
          • AVR memory spaces are shown in the figure given below.


          • ATmega328 Registers

            • ATmega-328 has thirty-two (32) General Purpose (GP) registers.
            • These all of the registers are part of Static Random Access Memory (SRAM).
            • All the registers are given in the figure shown below.

            • ATmega328 Packages

            • The different versions of the same device are denoted by the different packages of that device.
            • Each package has different dimensions, in order to differentiate easily.
            • ATmega 328 packages are given in the table shown in the figure given below.

            ATmega328 and Arduino

            • ATmega328 is the microcontroller used in the Arduino UNO board.
            • When we upload code in Arduino UNO, it's actually uploaded in the Atmega328 Microcontroller.
            • A software driver called bootloader is pre-installed in the flash memory of the Atmega328 microcontroller, which makes it compatible with Arduino IDE.



      Comments