SlideShare a Scribd company logo
Understanding Atmega328P Microcontroller
(Lecture-8)
R S Ananda Murthy
Associate Professor and Head
Department of Electrical & Electronics Engineering,
Sri Jayachamarajendra College of Engineering,
Mysore 570 006
R S Ananda Murthy Understanding Atmega328P Microcontroller
Atmega328P Features
High Performance, Low Power Atmel AVR 8-Bit
Microcontroller Family.
Advanced RISC Harvard Architecture
131 Powerful Instructions – Most Single Clock Cycle
Execution
32×8 General Purpose Working Registers
Fully Static Operation (with power on, the contents of
registers remain intact even with no clock signal)
Up to 20 MIPS Throughput at 20 MHz
On-chip 2-cycle Multiplier
Operating Voltage
1.8 V to 5.5 V
Temperature Range
−40◦ C to 85◦ C
R S Ananda Murthy Understanding Atmega328P Microcontroller
Atmega328P Features
High Endurance Non-volatile Memory Segments
32 K Bytes of In-System Self-Programmable Flash program
memory
1 K Bytes EEPROM
2 K Bytes Internal SRAM
Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
Optional Boot Code Section with Independent Lock Bits
Programming Lock for Software Security
I/O and Packages
23 Programmable I/O Lines
28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad
QFN/MLF
R S Ananda Murthy Understanding Atmega328P Microcontroller
Atmega328P Features
Peripheral Features
Two 8-bit Timer/Counters with Separate Prescaler and
Compare Mode
One 16-bit Timer/Counter with Separate Prescaler,
Compare Mode, and Capture Mode
Real Time Counter with Separate Oscillator
Six PWM Channels
8-channel 10-bit ADC in TQFP and QFN/MLF package
6-channel 10-bit ADC in PDIP Package
Programmable Serial USART
Master/Slave SPI Serial Interface
Byte-oriented 2-wire Serial Interface (Philips I2C
compatible)
Programmable Watchdog Timer with Separate On-chip
Oscillator
On-chip Analog Comparator
Interrupt and Wake-up on Pin Change
R S Ananda Murthy Understanding Atmega328P Microcontroller
Atmega328P Features
Special Microcontroller Features
Power-on Reset and Programmable Brown-out Detection
Internal Calibrated Oscillator
External and Internal Interrupt Sources
Six Sleep Modes: Idle, ADC Noise Reduction, Power-save,
Power-down, Standby, and Extended Standby
Speed Grade
0 - 4 MHz @ 1.8 - 5.5V, 0 - 10 MHz @ 2.7 - 5.5 V, 0 -
20MHz @ 4.5 - 5.5 V
Power Consumption at 1 MHz, 1.8 V, 25◦C
Active Mode: 0.2mA
Power-down Mode: 0.1µA
Power-save Mode: 0.75µA (Including 32kHz RTC)
R S Ananda Murthy Understanding Atmega328P Microcontroller
Types of Atmega328P Packages
28-Pin Plastic Dual In-line Package (PDIP)
R S Ananda Murthy Understanding Atmega328P Microcontroller
Types of Atmega328P Packages
32-pin Thin Quad Flat Package (TQFP)
R S Ananda Murthy Understanding Atmega328P Microcontroller
Types of Atmega328P Packages
32-pin Micro Lead Frame (MLF) or
Quad Flat No-leads (QFN) package.
A similar 28-pin package is also available.
R S Ananda Murthy Understanding Atmega328P Microcontroller
Atmega328P PDIP Pinout Details
Many pins have more than one function
R S Ananda Murthy Understanding Atmega328P Microcontroller
Atmega328P PDIP Signals
R S Ananda Murthy Understanding Atmega328P Microcontroller
Atmega328P 32-TQFP Signals
R S Ananda Murthy Understanding Atmega328P Microcontroller
Atmega328P 32-MLF Signals
R S Ananda Murthy Understanding Atmega328P Microcontroller
Pin Descriptions of Atmega328P
Vcc – Supply voltage.
GND – Ground.
Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2 – 8-bit
bi-directional I/O port with internal pull-up resistors.
Across PB7 and PB6 external oscillator or quartz crystal
should be connected to generate chip clock signal if
internal oscillator is not used.
PB7 and PB6 is used as TOSC2...1 input for the
Asynchronous Timer/Counter2 if the AS2 bit in ASSR is
set, when internal chip clock is used.
R S Ananda Murthy Understanding Atmega328P Microcontroller
Pin Descriptions of Atmega328P
Port C (PC5:0) – These are six lines of 7-bit bi-directional
I/O port with internal pull-up resistors.
PC6/RESET – Depending upon how the chip is
programmed, this pin can be used as an I/O pin or as input
to reset the MCU.
Port D (PD7:0) – 8-bit bi-directional I/O port with internal
pull-up resistors.
R S Ananda Murthy Understanding Atmega328P Microcontroller
Pin Descriptions of Atmega328P
AVcc – supply voltage pin for the A/D Converter, PC3:0,
and ADC7:6. It should be externally connected to Vcc ,
even if the ADC is not used. If the ADC is used, it should
be connected to Vcc through a low-pass filter.
AREF – the analog reference pin for the A/D Converter.
ADC7:6 (TQFP and QFN/MLF Package Only) – in the
TQFP and QFN/MLF package, ADC7:6 serve as analog
inputs to the A/D converter. These pins are powered from
the analog supply and serve as 10-bit ADC channels.
R S Ananda Murthy Understanding Atmega328P Microcontroller
Atmega328P Internal Block Diagram
R S Ananda Murthy Understanding Atmega328P Microcontroller
Atmega328P CPU Core Architecture
R S Ananda Murthy Understanding Atmega328P Microcontroller
Flash Program Memory in Atmega328P – 16K×16
16 Bits
D15 D14 D0D1D2. . . . . . . . . . .
$0000
$3FFF
Application Program
Section
Bootloader Section
Hex Address
16 K = 16384
Locations
Size of bootloader
section is configurable
using fuse bits
Bootloader is a
program executed by
the MCU to write code
into the flash memory
or read the code from
program memory.
Can endure at least 10,000 write/erase cycles. Nonvolatile.
Since the program memory address has 14 bits, the
Program Counter width is also 14 bits.
Bootloader can be protected using lock bits.
R S Ananda Murthy Understanding Atmega328P Microcontroller
SRAM Data Memory in Atmega328P – Volatile
32 Registers (GPRs)
D0D1D2. . . . . . . . . . . .
0x0000 - 0x001F
Hex Addresses
64 I/O Registers (SFRs)
D7
160 Ext I/O Registers
0x0020 - 0x005F
2048 x 8 Scratch Pad
0x0060 - 0x00FF
0x0100 - 0x08FF
8 Bits
Stores operands and results
of arithmetic/logical operations
Used to access peripherals
Used to access extra peripherals
Used to store temporary data
R S Ananda Murthy Understanding Atmega328P Microcontroller
EEPROM in Atmega328P
Size is 1 K×8.
It is organized as a separate data space, in which single
bytes can be read and written.
Can endure at least 100,000 write/erase cycles.
Non-volatile storage for program specific data, constants,
etc.
Requires special write sequence to store data.
Should be accessed using EEPROM Address Register,
EEPROM Data Register and EEPROM Control Register.
R S Ananda Murthy Understanding Atmega328P Microcontroller
License
This work is licensed under a
Creative Commons Attribution 4.0 International License.
R S Ananda Murthy Understanding Atmega328P Microcontroller

More Related Content

What's hot

ATMEGA 328
ATMEGA 328ATMEGA 328
ATMEGA 328
ABHISHEK MAURYA
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
Mathivanan Natarajan
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basics
sagar Ramdev
 
ARM CORTEX M3 PPT
ARM CORTEX M3 PPTARM CORTEX M3 PPT
ARM CORTEX M3 PPT
Gaurav Verma
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
Vikas Gupta
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
sravannunna24
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLER
Ankita Jaiswal
 
8051 Presentation
8051 Presentation8051 Presentation
8051 Presentation
Sayan Chakraborty
 
8051 microcontroller by K. Vijay Kumar
8051 microcontroller by K. Vijay Kumar8051 microcontroller by K. Vijay Kumar
8051 microcontroller by K. Vijay Kumar
Vijay Kumar
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
Gaurav Verma
 
Introduction to arm processor
Introduction to arm processorIntroduction to arm processor
Introduction to arm processor
RAMPRAKASHT1
 
Timer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerTimer And Counter in 8051 Microcontroller
Timer And Counter in 8051 Microcontroller
Jay Makwana
 
PPT on 8085 Microprocessor
PPT on 8085 Microprocessor  PPT on 8085 Microprocessor
PPT on 8085 Microprocessor
DebrajJana4
 
8086 micro processor
8086 micro processor8086 micro processor
8086 micro processor
Poojith Chowdhary
 
ARM7-ARCHITECTURE
ARM7-ARCHITECTURE ARM7-ARCHITECTURE
ARM7-ARCHITECTURE
Dr.YNM
 
Embedded systems - UNIT-1 - Mtech
Embedded systems - UNIT-1 - MtechEmbedded systems - UNIT-1 - Mtech
Embedded systems - UNIT-1 - Mtech
sangeetha rakhi
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)
Aarav Soni
 
Question paper with solution the 8051 microcontroller based embedded systems...
Question paper with solution  the 8051 microcontroller based embedded systems...Question paper with solution  the 8051 microcontroller based embedded systems...
Question paper with solution the 8051 microcontroller based embedded systems...
manishpatel_79
 
Datapath design
Datapath designDatapath design
Datapath design
Md Nazmul Hossain Mir
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
deval patel
 

What's hot (20)

ATMEGA 328
ATMEGA 328ATMEGA 328
ATMEGA 328
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basics
 
ARM CORTEX M3 PPT
ARM CORTEX M3 PPTARM CORTEX M3 PPT
ARM CORTEX M3 PPT
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLER
 
8051 Presentation
8051 Presentation8051 Presentation
8051 Presentation
 
8051 microcontroller by K. Vijay Kumar
8051 microcontroller by K. Vijay Kumar8051 microcontroller by K. Vijay Kumar
8051 microcontroller by K. Vijay Kumar
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
Introduction to arm processor
Introduction to arm processorIntroduction to arm processor
Introduction to arm processor
 
Timer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerTimer And Counter in 8051 Microcontroller
Timer And Counter in 8051 Microcontroller
 
PPT on 8085 Microprocessor
PPT on 8085 Microprocessor  PPT on 8085 Microprocessor
PPT on 8085 Microprocessor
 
8086 micro processor
8086 micro processor8086 micro processor
8086 micro processor
 
ARM7-ARCHITECTURE
ARM7-ARCHITECTURE ARM7-ARCHITECTURE
ARM7-ARCHITECTURE
 
Embedded systems - UNIT-1 - Mtech
Embedded systems - UNIT-1 - MtechEmbedded systems - UNIT-1 - Mtech
Embedded systems - UNIT-1 - Mtech
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)
 
Question paper with solution the 8051 microcontroller based embedded systems...
Question paper with solution  the 8051 microcontroller based embedded systems...Question paper with solution  the 8051 microcontroller based embedded systems...
Question paper with solution the 8051 microcontroller based embedded systems...
 
Datapath design
Datapath designDatapath design
Datapath design
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
 

Similar to L8 understanding-atmega328 p-1

A tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data SheetA tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data Sheet
Microtech Solutions
 
Atemega saya
Atemega sayaAtemega saya
Atemega saya
sulej77
 
Atmel 42735-8-bit-avr-microcontroller-a tmega328-328-p_summary
Atmel 42735-8-bit-avr-microcontroller-a tmega328-328-p_summaryAtmel 42735-8-bit-avr-microcontroller-a tmega328-328-p_summary
Atmel 42735-8-bit-avr-microcontroller-a tmega328-328-p_summary
Rajan Gautam
 
Atmega8u2 mur
Atmega8u2 murAtmega8u2 mur
Atmega8u2 mur
Nickyhoney
 
Atmega16 datasheet
Atmega16 datasheetAtmega16 datasheet
Atmega16 datasheet
chiragchitroda3
 
Atmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheetAtmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheet
Microtech Solutions
 
Atmel microcontrollers-a tmega328-p_datasheet
Atmel microcontrollers-a tmega328-p_datasheetAtmel microcontrollers-a tmega328-p_datasheet
Atmel microcontrollers-a tmega328-p_datasheet
AlexTronciu
 
Atmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheet
Atmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheetAtmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheet
Atmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheet
Arpan Saha
 
L9 understanding-atmega328 p-2
L9 understanding-atmega328 p-2L9 understanding-atmega328 p-2
L9 understanding-atmega328 p-2
rsamurti
 
Atmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheet
Atmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheetAtmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheet
Atmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheet
sang2792
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
Rup Chowdhury
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduino
Santosh Verma
 
Study on 32-bit Cortex - M3 Powered MCU: STM32F101
Study on 32-bit Cortex - M3 Powered MCU: STM32F101Study on 32-bit Cortex - M3 Powered MCU: STM32F101
Study on 32-bit Cortex - M3 Powered MCU: STM32F101
Premier Farnell
 
Atmega 8
Atmega 8Atmega 8
Atmega 8
Amri Yusron
 
Atmel-7735-Automotive-Microcontrollers-ATmega169P_-968165.pdf
Atmel-7735-Automotive-Microcontrollers-ATmega169P_-968165.pdfAtmel-7735-Automotive-Microcontrollers-ATmega169P_-968165.pdf
Atmel-7735-Automotive-Microcontrollers-ATmega169P_-968165.pdf
Miguel Angel Sejas Villarroel
 

Similar to L8 understanding-atmega328 p-1 (20)

Atmega32
Atmega32Atmega32
Atmega32
 
Atmega 32
Atmega 32Atmega 32
Atmega 32
 
A tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data SheetA tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data Sheet
 
Atemega saya
Atemega sayaAtemega saya
Atemega saya
 
Atmel 42735-8-bit-avr-microcontroller-a tmega328-328-p_summary
Atmel 42735-8-bit-avr-microcontroller-a tmega328-328-p_summaryAtmel 42735-8-bit-avr-microcontroller-a tmega328-328-p_summary
Atmel 42735-8-bit-avr-microcontroller-a tmega328-328-p_summary
 
Atmega8u2 mur
Atmega8u2 murAtmega8u2 mur
Atmega8u2 mur
 
Atmega16 datasheet
Atmega16 datasheetAtmega16 datasheet
Atmega16 datasheet
 
Atmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheetAtmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheet
 
Atmel microcontrollers-a tmega328-p_datasheet
Atmel microcontrollers-a tmega328-p_datasheetAtmel microcontrollers-a tmega328-p_datasheet
Atmel microcontrollers-a tmega328-p_datasheet
 
A tmega8 l
A tmega8 lA tmega8 l
A tmega8 l
 
Atmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheet
Atmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheetAtmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheet
Atmel 8159-8-bit-avr-microcontroller-a tmega8-a_datasheet
 
Doc2502
Doc2502Doc2502
Doc2502
 
L9 understanding-atmega328 p-2
L9 understanding-atmega328 p-2L9 understanding-atmega328 p-2
L9 understanding-atmega328 p-2
 
Atmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheet
Atmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheetAtmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheet
Atmel 2486-8-bit-avr-microcontroller-atmega8 l-datasheet
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduino
 
Study on 32-bit Cortex - M3 Powered MCU: STM32F101
Study on 32-bit Cortex - M3 Powered MCU: STM32F101Study on 32-bit Cortex - M3 Powered MCU: STM32F101
Study on 32-bit Cortex - M3 Powered MCU: STM32F101
 
Atmega324 p
Atmega324 pAtmega324 p
Atmega324 p
 
Atmega 8
Atmega 8Atmega 8
Atmega 8
 
Atmel-7735-Automotive-Microcontrollers-ATmega169P_-968165.pdf
Atmel-7735-Automotive-Microcontrollers-ATmega169P_-968165.pdfAtmel-7735-Automotive-Microcontrollers-ATmega169P_-968165.pdf
Atmel-7735-Automotive-Microcontrollers-ATmega169P_-968165.pdf
 

More from rsamurti

EE110-elementary-circuit-and-network-theory-(a)
EE110-elementary-circuit-and-network-theory-(a)EE110-elementary-circuit-and-network-theory-(a)
EE110-elementary-circuit-and-network-theory-(a)
rsamurti
 
Trends in-power-electronics
Trends in-power-electronicsTrends in-power-electronics
Trends in-power-electronics
rsamurti
 
L3 instruction-execution-steps
L3 instruction-execution-stepsL3 instruction-execution-steps
L3 instruction-execution-steps
rsamurti
 
L1 intro-to-mpu-mcu
L1 intro-to-mpu-mcuL1 intro-to-mpu-mcu
L1 intro-to-mpu-mcu
rsamurti
 
Introduction to-Tex-and-LaTeX
Introduction to-Tex-and-LaTeXIntroduction to-Tex-and-LaTeX
Introduction to-Tex-and-LaTeX
rsamurti
 
Synchronous generators
Synchronous generatorsSynchronous generators
Synchronous generators
rsamurti
 
Transformers
TransformersTransformers
Transformers
rsamurti
 
Three phase-circuits
Three phase-circuitsThree phase-circuits
Three phase-circuits
rsamurti
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 p
rsamurti
 
L14 kb-lcd-interfacing-with-atmega328 p
L14 kb-lcd-interfacing-with-atmega328 pL14 kb-lcd-interfacing-with-atmega328 p
L14 kb-lcd-interfacing-with-atmega328 p
rsamurti
 
L13 interrupts-in-atmega328 p
L13 interrupts-in-atmega328 pL13 interrupts-in-atmega328 p
L13 interrupts-in-atmega328 p
rsamurti
 
L12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 pL12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 p
rsamurti
 
L16 usart-atmega328 p
L16 usart-atmega328 pL16 usart-atmega328 p
L16 usart-atmega328 p
rsamurti
 
L11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 pL11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 p
rsamurti
 
L10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 pL10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 p
rsamurti
 
L7 starting-to-use-mcu
L7 starting-to-use-mcuL7 starting-to-use-mcu
L7 starting-to-use-mcu
rsamurti
 
L6 primary-memory
L6 primary-memoryL6 primary-memory
L6 primary-memory
rsamurti
 
L5 data-parallel-computers
L5 data-parallel-computersL5 data-parallel-computers
L5 data-parallel-computers
rsamurti
 
L4 speeding-up-execution
L4 speeding-up-executionL4 speeding-up-execution
L4 speeding-up-execution
rsamurti
 
L2 types-of-computers
L2 types-of-computersL2 types-of-computers
L2 types-of-computers
rsamurti
 

More from rsamurti (20)

EE110-elementary-circuit-and-network-theory-(a)
EE110-elementary-circuit-and-network-theory-(a)EE110-elementary-circuit-and-network-theory-(a)
EE110-elementary-circuit-and-network-theory-(a)
 
Trends in-power-electronics
Trends in-power-electronicsTrends in-power-electronics
Trends in-power-electronics
 
L3 instruction-execution-steps
L3 instruction-execution-stepsL3 instruction-execution-steps
L3 instruction-execution-steps
 
L1 intro-to-mpu-mcu
L1 intro-to-mpu-mcuL1 intro-to-mpu-mcu
L1 intro-to-mpu-mcu
 
Introduction to-Tex-and-LaTeX
Introduction to-Tex-and-LaTeXIntroduction to-Tex-and-LaTeX
Introduction to-Tex-and-LaTeX
 
Synchronous generators
Synchronous generatorsSynchronous generators
Synchronous generators
 
Transformers
TransformersTransformers
Transformers
 
Three phase-circuits
Three phase-circuitsThree phase-circuits
Three phase-circuits
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 p
 
L14 kb-lcd-interfacing-with-atmega328 p
L14 kb-lcd-interfacing-with-atmega328 pL14 kb-lcd-interfacing-with-atmega328 p
L14 kb-lcd-interfacing-with-atmega328 p
 
L13 interrupts-in-atmega328 p
L13 interrupts-in-atmega328 pL13 interrupts-in-atmega328 p
L13 interrupts-in-atmega328 p
 
L12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 pL12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 p
 
L16 usart-atmega328 p
L16 usart-atmega328 pL16 usart-atmega328 p
L16 usart-atmega328 p
 
L11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 pL11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 p
 
L10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 pL10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 p
 
L7 starting-to-use-mcu
L7 starting-to-use-mcuL7 starting-to-use-mcu
L7 starting-to-use-mcu
 
L6 primary-memory
L6 primary-memoryL6 primary-memory
L6 primary-memory
 
L5 data-parallel-computers
L5 data-parallel-computersL5 data-parallel-computers
L5 data-parallel-computers
 
L4 speeding-up-execution
L4 speeding-up-executionL4 speeding-up-execution
L4 speeding-up-execution
 
L2 types-of-computers
L2 types-of-computersL2 types-of-computers
L2 types-of-computers
 

Recently uploaded

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
Kamal Acharya
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
zwunae
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 

Recently uploaded (20)

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 

L8 understanding-atmega328 p-1

  • 1. Understanding Atmega328P Microcontroller (Lecture-8) R S Ananda Murthy Associate Professor and Head Department of Electrical & Electronics Engineering, Sri Jayachamarajendra College of Engineering, Mysore 570 006 R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 2. Atmega328P Features High Performance, Low Power Atmel AVR 8-Bit Microcontroller Family. Advanced RISC Harvard Architecture 131 Powerful Instructions – Most Single Clock Cycle Execution 32×8 General Purpose Working Registers Fully Static Operation (with power on, the contents of registers remain intact even with no clock signal) Up to 20 MIPS Throughput at 20 MHz On-chip 2-cycle Multiplier Operating Voltage 1.8 V to 5.5 V Temperature Range −40◦ C to 85◦ C R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 3. Atmega328P Features High Endurance Non-volatile Memory Segments 32 K Bytes of In-System Self-Programmable Flash program memory 1 K Bytes EEPROM 2 K Bytes Internal SRAM Write/Erase Cycles: 10,000 Flash/100,000 EEPROM Optional Boot Code Section with Independent Lock Bits Programming Lock for Software Security I/O and Packages 23 Programmable I/O Lines 28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 4. Atmega328P Features Peripheral Features Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode Real Time Counter with Separate Oscillator Six PWM Channels 8-channel 10-bit ADC in TQFP and QFN/MLF package 6-channel 10-bit ADC in PDIP Package Programmable Serial USART Master/Slave SPI Serial Interface Byte-oriented 2-wire Serial Interface (Philips I2C compatible) Programmable Watchdog Timer with Separate On-chip Oscillator On-chip Analog Comparator Interrupt and Wake-up on Pin Change R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 5. Atmega328P Features Special Microcontroller Features Power-on Reset and Programmable Brown-out Detection Internal Calibrated Oscillator External and Internal Interrupt Sources Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby, and Extended Standby Speed Grade 0 - 4 MHz @ 1.8 - 5.5V, 0 - 10 MHz @ 2.7 - 5.5 V, 0 - 20MHz @ 4.5 - 5.5 V Power Consumption at 1 MHz, 1.8 V, 25◦C Active Mode: 0.2mA Power-down Mode: 0.1µA Power-save Mode: 0.75µA (Including 32kHz RTC) R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 6. Types of Atmega328P Packages 28-Pin Plastic Dual In-line Package (PDIP) R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 7. Types of Atmega328P Packages 32-pin Thin Quad Flat Package (TQFP) R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 8. Types of Atmega328P Packages 32-pin Micro Lead Frame (MLF) or Quad Flat No-leads (QFN) package. A similar 28-pin package is also available. R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 9. Atmega328P PDIP Pinout Details Many pins have more than one function R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 10. Atmega328P PDIP Signals R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 11. Atmega328P 32-TQFP Signals R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 12. Atmega328P 32-MLF Signals R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 13. Pin Descriptions of Atmega328P Vcc – Supply voltage. GND – Ground. Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2 – 8-bit bi-directional I/O port with internal pull-up resistors. Across PB7 and PB6 external oscillator or quartz crystal should be connected to generate chip clock signal if internal oscillator is not used. PB7 and PB6 is used as TOSC2...1 input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set, when internal chip clock is used. R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 14. Pin Descriptions of Atmega328P Port C (PC5:0) – These are six lines of 7-bit bi-directional I/O port with internal pull-up resistors. PC6/RESET – Depending upon how the chip is programmed, this pin can be used as an I/O pin or as input to reset the MCU. Port D (PD7:0) – 8-bit bi-directional I/O port with internal pull-up resistors. R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 15. Pin Descriptions of Atmega328P AVcc – supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It should be externally connected to Vcc , even if the ADC is not used. If the ADC is used, it should be connected to Vcc through a low-pass filter. AREF – the analog reference pin for the A/D Converter. ADC7:6 (TQFP and QFN/MLF Package Only) – in the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D converter. These pins are powered from the analog supply and serve as 10-bit ADC channels. R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 16. Atmega328P Internal Block Diagram R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 17. Atmega328P CPU Core Architecture R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 18. Flash Program Memory in Atmega328P – 16K×16 16 Bits D15 D14 D0D1D2. . . . . . . . . . . $0000 $3FFF Application Program Section Bootloader Section Hex Address 16 K = 16384 Locations Size of bootloader section is configurable using fuse bits Bootloader is a program executed by the MCU to write code into the flash memory or read the code from program memory. Can endure at least 10,000 write/erase cycles. Nonvolatile. Since the program memory address has 14 bits, the Program Counter width is also 14 bits. Bootloader can be protected using lock bits. R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 19. SRAM Data Memory in Atmega328P – Volatile 32 Registers (GPRs) D0D1D2. . . . . . . . . . . . 0x0000 - 0x001F Hex Addresses 64 I/O Registers (SFRs) D7 160 Ext I/O Registers 0x0020 - 0x005F 2048 x 8 Scratch Pad 0x0060 - 0x00FF 0x0100 - 0x08FF 8 Bits Stores operands and results of arithmetic/logical operations Used to access peripherals Used to access extra peripherals Used to store temporary data R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 20. EEPROM in Atmega328P Size is 1 K×8. It is organized as a separate data space, in which single bytes can be read and written. Can endure at least 100,000 write/erase cycles. Non-volatile storage for program specific data, constants, etc. Requires special write sequence to store data. Should be accessed using EEPROM Address Register, EEPROM Data Register and EEPROM Control Register. R S Ananda Murthy Understanding Atmega328P Microcontroller
  • 21. License This work is licensed under a Creative Commons Attribution 4.0 International License. R S Ananda Murthy Understanding Atmega328P Microcontroller