SlideShare a Scribd company logo
Here Architecture is of Arduino or precisely the IC of Arduino
(ATmega328p). The ATmega328/P is a low-power CMOS 8-bit
microcontroller based on the AVR® enhanced RISC (reduced
instruction set computer) architecture.
In Order to maximize performance and parallelism, the AVR
uses Harvard architecture – with separate memories and buses for
program and data. Instruction in the program memory are
executed with a single level of pipelining.
The clock is controlled by an external 16MHz Crystal Oscillator.
•14 digital input/output pins (of which 6 can be used as
PWM outputs)
• 6 analog inputs
•16 MHz quartz crystal
• A USB connection, a power jack, an ICSP header
and a reset button.
•It contains everything needed to support the
microcontroller, simply connect it to a computer with a
USB cable or power it with a AC-to-DC adapter or
battery to get started.
•You can tinker with your UNO without worrying too
much about doing something wrong, worst case
scenario you can replace the chip for a few dollars and
start over again.
Basic working of CPU of ATmega328:-
1. The data is uploaded in serial via the port (being uploaded from the
computer’s Arduino IDE). The data is decoded and then the instructions are sent
to instruction register and it decodes the instructions on the same clock pulse.
2. On the next clock pulse the next set of instructions are loaded in instruction
register.
3. In general purpose registers the registers are of 8-bit but there are 3 16-bit
registers also.
a. 8-bit registers are used to store data for normal calculations and results.
b. 16-bit registers are used to store data of timer counter in 2 different register.
Eg. X-low & X-high. They are fast, and are used to store specific hardware
functions.
4. EEPROM stores data permanently even if the power is cut out. Programming
inside a EEPROM is slow.
5. Interrupt Unit checks whether there is an interrupt for the execution of
instruction to be executed in ISR (Interrupt Service Routine).
6. Serial Peripheral Interface (SPI) is an interface bus commonly used to send
data between microcontrollers and small peripherals such as Camera, Display, SD
cards, etc. It uses separate clock and data lines, along with a select line to choose
the device you wish to talk to
•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.
•VCC is a digital voltage supply.
•AVCC is a supply voltage pin for analog to digital converter.
•GND denotes Ground and it has a 0V.
•Port A consists of the pins from PA0 to PA7.
These pins serve as analog input to analog to digital converters. If
analog to digital converter is not used, port A acts as an eight (8)
bit bidirectional input/output port.
Port B consists of the pins from PB0 to PB7. This port is an 8 bit
bidirectional port having an internal pull-up resistor.
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.
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.Watchdog timer is used to detect and recover from MCU
malfunctioning.
8. Analog comparator compares the input values on the positive and
negative pin, when the value of positive pin is higher the output is set.
9. Status and control is used to control the flow of execution of
commands by checking other blocks inside the CPU at regular
intervals.
10. ALU (Arithmetic and Logical unit)The high performance AVR ALU
operates in direct connection with all the 32 general purpose working
registers. Within a single clock cycle, arithmetic operations b/w
general purpose registers are executed. The ALU operations are
divided into 3 main categories – arithmetic, logical and bit-function.
11. I/O pins The digital inputs and outputs (digital I/O) on the Arduino
are what allow you to connect the Arduino sensors, actuators, and
other ICs. Learning how to use them will allow you to use the Arduino
to do some really useful things, such as reading switch inputs, lighting
indicators, and controlling relay outputs.
Atmel 328p Microcontroller Block Diagram
•ADC
•The Atmega328 chip has an analog-to-digital converter (ADC) inside of it. This
must be or else the Atmega328 wouldn't be capable of interpreting analog signals.
Because there is an ADC, the chip can interpret analog input, which is why the chip
has 6 pins for analog input.
•The ADC has 3 pins set aside for it to function- AVCC, AREF, and GND.
•AVCC is the power supply, positive voltage, that for the ADC. The ADC needs its
own power supply in order to work.
•GND is the power supply ground.
•AREF is the reference voltage that the ADC uses to convert an analog signal to its
corresponding digital value.
•Analog voltages higher than the reference voltage will be assigned to a digital value
of 1, while analog voltages below the reference voltage will be assigned the digital
value of 0.
•Since the ADC for the Atmega328 is a 10-bit ADC, meaning it produces a 10-bit
digital value, it converts an analog signal to its digital value, with the AREF value
being a reference for which digital values are high or low.
•Thus, a portrait of an analog signal is shown by this digital value; thus, it is its
digital correspondent value.
•The last pin is the RESET pin. This allows a program to be rerun and start over.
It one of the best serial communication systems in the case of multiple peripherals.
•SPI –Serial Peripheral Interface
protocol allows multiple devices to use the same channel for communication. It consists
of four wires, two for data sending and one for clock but the fourth wire is used to
select the peripherals knows as a select slave. In the case of multiple peripherals
number of the select slave, pins will be increased.
The SPI pins of the microcontroller are: MOSI,MISO,SS,SCK
•I2C –Inter Integrated Circuit Communication
Most of the peripherals come with the I2C Communication method which is one way
at a specific time. I2C protocol only uses one data wire and one clock wire. Data wire
will transfer and receive the data and clock wire will send the clock pulse to keep the
data sync.
The wires on the microcontroller are: SDA-serial data line, SCL-serial clock line
•USART- Universal Synchronous and Asynchronous serial Receiver and Transmitter
Universal Synchronous and Asynchronous serial Receiver and Transmitter (USART) is
a configurable peripheral of ATmega328p which supports both Synchronous (SPI) and
Asynchronous(Serial) communication protocols.
•COMPARATOR MODULE
The microcontroller has internal comparator modules for analog signal. This module takes the input
in inverting and non-inverting form which can be used further for any internal purpose or it can also
be used to generate the output signals. Comparator pins of the microcontroller are listed below:
AN0 (Positive),AN1 (Negative)
•ATmega328P CAPTURE/COMPARE/PWM Channels
There are six capture/compare/PWM pins are used to generate the desired time pulse-based signal. It
uses a Prescaler to divide the time pulse. All of these pins in ATmega328P are:
Timer 0 and Timer2 – 8 bit
Timer 1- 16 bit
OC0B ,OC0A,OC1A,OC1B,OC2A,OC2B -Output Compare Registers (OCR0A and OCR0B)
The result of the compare can be used by the Waveform Generator to generate a PWM or variable
frequency output on the Output Compare pins (OC0A and OC0B).
•Watchdog timer is used to detect and recover from MCU malfunctioning
•OSCILLATOR
The controller comes with 8MHz changeable oscillator. However, it can also use the external
oscillator up to 40MHz. To use the external oscillator, oscillation pins will be required for input and
output of the signal. Those pins are given below:
XTAL1,XTAL2

More Related Content

Similar to ATmegaMicrocontrollerArchitecturenotes.pptx

8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessor
Iama Marsian
 

Similar to ATmegaMicrocontrollerArchitecturenotes.pptx (20)

Atmega32
Atmega32Atmega32
Atmega32
 
Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduino
 
Atmega 32
Atmega 32Atmega 32
Atmega 32
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
 
Microprocessors
MicroprocessorsMicroprocessors
Microprocessors
 
Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32 Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessor
 
A tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data SheetA tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data Sheet
 
PIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikarPIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikar
 
iot1&2.pdf
iot1&2.pdfiot1&2.pdf
iot1&2.pdf
 
An Overview of LPC2101/02/03
An Overview of LPC2101/02/03An Overview of LPC2101/02/03
An Overview of LPC2101/02/03
 
Arduino_Beginner.pptx
Arduino_Beginner.pptxArduino_Beginner.pptx
Arduino_Beginner.pptx
 
Arduino Programming Basic
Arduino Programming BasicArduino Programming Basic
Arduino Programming Basic
 
embedded system
embedded systemembedded system
embedded system
 
Embedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerEmbedded systems, 8051 microcontroller
Embedded systems, 8051 microcontroller
 
Atmega16 datasheet
Atmega16 datasheetAtmega16 datasheet
Atmega16 datasheet
 
Atmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheetAtmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheet
 
Arduino_Beginner.pptx
Arduino_Beginner.pptxArduino_Beginner.pptx
Arduino_Beginner.pptx
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessor
 

Recently uploaded

RS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
RS Khurmi Machine Design Clutch and Brake Exercise Numerical SolutionsRS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
RS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
Atif Razi
 
Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdf
Kamal Acharya
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
Kamal Acharya
 
Hall booking system project report .pdf
Hall booking system project report  .pdfHall booking system project report  .pdf
Hall booking system project report .pdf
Kamal Acharya
 

Recently uploaded (20)

KIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data StreamKIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
 
RS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
RS Khurmi Machine Design Clutch and Brake Exercise Numerical SolutionsRS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
RS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
 
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docxThe Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
 
Pharmacy management system project report..pdf
Pharmacy management system project report..pdfPharmacy management system project report..pdf
Pharmacy management system project report..pdf
 
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
 
fundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projectionfundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projection
 
Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdf
 
KIT-601 Lecture Notes-UNIT-5.pdf Frame Works and Visualization
KIT-601 Lecture Notes-UNIT-5.pdf Frame Works and VisualizationKIT-601 Lecture Notes-UNIT-5.pdf Frame Works and Visualization
KIT-601 Lecture Notes-UNIT-5.pdf Frame Works and Visualization
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
 
Scaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltageScaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltage
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
Hall booking system project report .pdf
Hall booking system project report  .pdfHall booking system project report  .pdf
Hall booking system project report .pdf
 

ATmegaMicrocontrollerArchitecturenotes.pptx

  • 1.
  • 2.
  • 3.
  • 4. Here Architecture is of Arduino or precisely the IC of Arduino (ATmega328p). The ATmega328/P is a low-power CMOS 8-bit microcontroller based on the AVR® enhanced RISC (reduced instruction set computer) architecture. In Order to maximize performance and parallelism, the AVR uses Harvard architecture – with separate memories and buses for program and data. Instruction in the program memory are executed with a single level of pipelining. The clock is controlled by an external 16MHz Crystal Oscillator.
  • 5.
  • 6. •14 digital input/output pins (of which 6 can be used as PWM outputs) • 6 analog inputs •16 MHz quartz crystal • A USB connection, a power jack, an ICSP header and a reset button. •It contains everything needed to support the microcontroller, simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. •You can tinker with your UNO without worrying too much about doing something wrong, worst case scenario you can replace the chip for a few dollars and start over again.
  • 7.
  • 8.
  • 9. Basic working of CPU of ATmega328:- 1. The data is uploaded in serial via the port (being uploaded from the computer’s Arduino IDE). The data is decoded and then the instructions are sent to instruction register and it decodes the instructions on the same clock pulse. 2. On the next clock pulse the next set of instructions are loaded in instruction register. 3. In general purpose registers the registers are of 8-bit but there are 3 16-bit registers also. a. 8-bit registers are used to store data for normal calculations and results. b. 16-bit registers are used to store data of timer counter in 2 different register. Eg. X-low & X-high. They are fast, and are used to store specific hardware functions. 4. EEPROM stores data permanently even if the power is cut out. Programming inside a EEPROM is slow. 5. Interrupt Unit checks whether there is an interrupt for the execution of instruction to be executed in ISR (Interrupt Service Routine). 6. Serial Peripheral Interface (SPI) is an interface bus commonly used to send data between microcontrollers and small peripherals such as Camera, Display, SD cards, etc. It uses separate clock and data lines, along with a select line to choose the device you wish to talk to
  • 10. •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. •VCC is a digital voltage supply. •AVCC is a supply voltage pin for analog to digital converter. •GND denotes Ground and it has a 0V. •Port A consists of the pins from PA0 to PA7. These pins serve as analog input to analog to digital converters. If analog to digital converter is not used, port A acts as an eight (8) bit bidirectional input/output port. Port B consists of the pins from PB0 to PB7. This port is an 8 bit bidirectional port having an internal pull-up resistor. 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. 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.
  • 11. 7.Watchdog timer is used to detect and recover from MCU malfunctioning. 8. Analog comparator compares the input values on the positive and negative pin, when the value of positive pin is higher the output is set. 9. Status and control is used to control the flow of execution of commands by checking other blocks inside the CPU at regular intervals. 10. ALU (Arithmetic and Logical unit)The high performance AVR ALU operates in direct connection with all the 32 general purpose working registers. Within a single clock cycle, arithmetic operations b/w general purpose registers are executed. The ALU operations are divided into 3 main categories – arithmetic, logical and bit-function. 11. I/O pins The digital inputs and outputs (digital I/O) on the Arduino are what allow you to connect the Arduino sensors, actuators, and other ICs. Learning how to use them will allow you to use the Arduino to do some really useful things, such as reading switch inputs, lighting indicators, and controlling relay outputs.
  • 12. Atmel 328p Microcontroller Block Diagram
  • 13. •ADC •The Atmega328 chip has an analog-to-digital converter (ADC) inside of it. This must be or else the Atmega328 wouldn't be capable of interpreting analog signals. Because there is an ADC, the chip can interpret analog input, which is why the chip has 6 pins for analog input. •The ADC has 3 pins set aside for it to function- AVCC, AREF, and GND. •AVCC is the power supply, positive voltage, that for the ADC. The ADC needs its own power supply in order to work. •GND is the power supply ground. •AREF is the reference voltage that the ADC uses to convert an analog signal to its corresponding digital value. •Analog voltages higher than the reference voltage will be assigned to a digital value of 1, while analog voltages below the reference voltage will be assigned the digital value of 0. •Since the ADC for the Atmega328 is a 10-bit ADC, meaning it produces a 10-bit digital value, it converts an analog signal to its digital value, with the AREF value being a reference for which digital values are high or low. •Thus, a portrait of an analog signal is shown by this digital value; thus, it is its digital correspondent value. •The last pin is the RESET pin. This allows a program to be rerun and start over.
  • 14. It one of the best serial communication systems in the case of multiple peripherals. •SPI –Serial Peripheral Interface protocol allows multiple devices to use the same channel for communication. It consists of four wires, two for data sending and one for clock but the fourth wire is used to select the peripherals knows as a select slave. In the case of multiple peripherals number of the select slave, pins will be increased. The SPI pins of the microcontroller are: MOSI,MISO,SS,SCK •I2C –Inter Integrated Circuit Communication Most of the peripherals come with the I2C Communication method which is one way at a specific time. I2C protocol only uses one data wire and one clock wire. Data wire will transfer and receive the data and clock wire will send the clock pulse to keep the data sync. The wires on the microcontroller are: SDA-serial data line, SCL-serial clock line •USART- Universal Synchronous and Asynchronous serial Receiver and Transmitter Universal Synchronous and Asynchronous serial Receiver and Transmitter (USART) is a configurable peripheral of ATmega328p which supports both Synchronous (SPI) and Asynchronous(Serial) communication protocols.
  • 15. •COMPARATOR MODULE The microcontroller has internal comparator modules for analog signal. This module takes the input in inverting and non-inverting form which can be used further for any internal purpose or it can also be used to generate the output signals. Comparator pins of the microcontroller are listed below: AN0 (Positive),AN1 (Negative) •ATmega328P CAPTURE/COMPARE/PWM Channels There are six capture/compare/PWM pins are used to generate the desired time pulse-based signal. It uses a Prescaler to divide the time pulse. All of these pins in ATmega328P are: Timer 0 and Timer2 – 8 bit Timer 1- 16 bit OC0B ,OC0A,OC1A,OC1B,OC2A,OC2B -Output Compare Registers (OCR0A and OCR0B) The result of the compare can be used by the Waveform Generator to generate a PWM or variable frequency output on the Output Compare pins (OC0A and OC0B). •Watchdog timer is used to detect and recover from MCU malfunctioning •OSCILLATOR The controller comes with 8MHz changeable oscillator. However, it can also use the external oscillator up to 40MHz. To use the external oscillator, oscillation pins will be required for input and output of the signal. Those pins are given below: XTAL1,XTAL2