SlideShare a Scribd company logo
1 of 15
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

Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!Makers of India
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduinoSantosh Verma
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerRup Chowdhury
 
A tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data SheetA tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data SheetMicrotech Solutions
 
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 raikarGauravRaikar3
 
An Overview of LPC2101/02/03
An Overview of LPC2101/02/03An Overview of LPC2101/02/03
An Overview of LPC2101/02/03Premier Farnell
 
Arduino_Beginner.pptx
Arduino_Beginner.pptxArduino_Beginner.pptx
Arduino_Beginner.pptxshivagoud45
 
Embedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerEmbedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerAmandeep Alag
 
Atmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheetAtmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheetMicrotech Solutions
 
Arduino_Beginner.pptx
Arduino_Beginner.pptxArduino_Beginner.pptx
Arduino_Beginner.pptxaravind Guru
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessorIama 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

(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 

Recently uploaded (20)

(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 

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