SlideShare a Scribd company logo
https://technoelectronics44.blogspot.com/202
0/08/atmega-328p.html
What is ATMEGA-328P
The ATmega328 is a single-chip microcontroller created by Atmel with inside
the megaAVR family, later Microchip Technology acquired Atmel in 2016.
The alternative to the ATMEGA328 is “Pico power” MCU (ATMEGA328P)
 ATMEGAp-328
 ATMEGA-328p
 ATMEGA-328PB, ATMEGA-328PB(AUTOMOTIVE)-advance to the
ATMEGA-328P(more UART, SPI, Memory...)
ATMEGA-328P-TQFP
ATMEGA-328P-PU DIP
USER MANUAL: User manual
Technical specifications
ATMEGA-328P
Processor 8-Bit AVR-RISC
External Oscillator 16Mhz
Architecture Harvard
Flash memory type Enabled
Flash memory 32kb
EEPROM 1Kb
SRAM 2kb
ADC 10-bit (6 channels)
Performance 1 MIPS per 1 MHZ
Write/erase cycles flash =10,000
EEPROM=100,000
Timers 2-8bit, 1-16bit Timers
Pins 28(DIP),32(TQFP)
Operating voltage 2.7v to 5.5v
Operating
temperature
-40 ͦC to +125 ͦC.
PWM channels 6
Communication 1-UART, 2-SPI, 1-I2C
Internal RC oscillator 8MHZ
I/O pin current ratings 40ma
Pin Description: ATMEGA328P-28pin
It has a total of 28 pins, each pin will perform multiple functionalities, based on the
pin functionalities we can describe as follows.
ATMEGA-328P Pin diagram
GPIO pins: General purpose input-output pins
It has three ports PORT-B, PORT-C, PORT-D. PORT-B has eight pins from PB0-
PB7, PORT-C has seven pins from PC0-PC6 and PORT-D has eight pins from PD0-
PD7. Every pin can work as a digital I/O pin. If you want to use these pins as input or
output you need to configure them using the program, otherwise, some error readings
will obtain.
PORT-B =PB0, PB1, PB2,PB3, PB4,PB5,PB6,PB7.
PORT-C =PC0, PC1, PC2,PC3, PC4,PC5,PC6.
PORT-D =PD0,PD1, PD2,PD3,PD4,PD5,
PD6,PD7.
Communication pins: Serial communication
Serial communication supported by ATMEGA328P: 1-UART, 1-I2C, 2-SPI
UART: Universal asynchronous receiver transmitter
It has one UART communication it has two pins RX, TX
 RX (Receive data) –PD0/2
 TX (Transmit data)-PD1/3
I2C: Inter-Integrated Circuit.
 SCL (Serial Clock) –PC5/28
 SDA (Serial Data)-PC4/27
SPI: serial peripheral interface
 SCK (Clock) –PB5/19
 MISO (Master In Slave Out) –PB4/18
 MOSI (Master Out Slave IN) –PB3/17
 SS (Slave Select) –PB2/16
INTERRUPTS: External interrupts
 Interrupts are use full to execute the high priority task.
 It has two external interrupts
 INT0-External Interrupt Source 0-PD2/4
 INT1- External Interrupt Source 1-PD3/5
ADC: Analog to Digital Converter (10-BIT)
It has six ADC channels
ADC0-PC0/23
ADC1-PC1/24
ADC2-PC2/25
ADC3-PC3/26
ADC4-PC4/27
ADC5-PC5/28
TIMERS: Timer/Counter
It has two 16 bit timers
 T0-Timer/counter 0-PD4/6
 T1- Timer/counter 1-PD5/11
Comparator
 AIN0-Analog comparator positive input, configure as an input pin and disable
the pullup resistor-PD6/12
 AIN1-Analog comparator negative input, configure as an input pin and disable
the pullup resistor-PD7/13
CLOCK
To execute the set of instructions we need to provide the clock source
 XTAL1-External clock source pin 0 (Crystal oscillator) used to all chip clock
source except internal RC oscillator—PB6/9
 XTAL2- External clock source pin 1 (Crystal oscillator)- -PB7/10
 CLK0- divides the system clock-PB0/14
 TOSC1 –Timer oscillator pin1, used only when the internal clock frequency as
chip clock source-PB6/9
 TOSC2 –Timer oscillator pin2, used only when the internal clock frequency as
chip clock source-PB7/10
PCINT: Pin change Interrupt (PCINT0-PCINT23)
Its interesting feature is any of the pins we can configure as an interrupt pin, So we set the
functionality of the pin as an interrupt.
Capture and PWM channel (OC (Output compare),IC(Input compare))
OC: Output compare match, it provides the external output to the Timer/Counter match output.
IC: Input compare pin, it acts as an input capture pin for the corresponding pin.
 OC0A-PD6/12
 OC0B-PD5/11
 OC1A-PB1/15
 OC1B-PB2/16
 OC2A-PB3/17
 OC2B-PD3/5
 ICP1-PB0/14
RESET: Reset pin-PC6/1
It is an active LOW state pin, it acts as an input pin when it is programmed it depends on power-
on reset and brown-out reset functions. When it is unprogrammed it depends on the
input reset circuitry.
AREF: Analog reference voltage--21
ARef is the external power supply to the ADC module, by default ADC takes the Vcc (5V) of the
controller.
If you want to set any customized voltage to ADC module you have to use the ARef pin.
AVcc: Analog power pin-20
It is used to activate the ADC operation.
POWER: Power supply pins
 VCC – 7
 GND- 8, 22
HOW TO USE ATMEGA328P
If you want to work with any microcontroller you need to remember two things
 Hardware setup
 Software setup
Hardware setup
Microcontroller the developing board needs minimum hardware configuration, those are
power supply the unit, operating frequency (crystal unit), Reset circuitry and finally, you
need to set up a boot loader for the flash program.
Software setup
To develop any application program you have a compiler or IDE. Download the compiler
and install it from core foundry website (MICROCHIP). For ATMEGA328 u have to prefer -
ATMEL-STUDIO IDE
Download link: CLICK HERE
NOTE: For easy purpose go to ARDUINO(ATMEGA 328P) controller.
Applications
 Embedded products design.
 Voltage controller unit
 Digital Energy meters
 Familiar with the Arduino family.
Reference links:
https://www.microchip.com/wwwproducts/en/atmega328p
http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-
ATmega328P_Datasheet.pdf
https://en.wikipedia.org/wiki/ATmega328.

More Related Content

What's hot

RTC Interfacing and Programming
RTC Interfacing and ProgrammingRTC Interfacing and Programming
RTC Interfacing and ProgrammingDevashish Raval
 
Heart rate monitoring system using arduino
Heart rate monitoring system using  arduinoHeart rate monitoring system using  arduino
Heart rate monitoring system using arduinosoundaryasheshachala
 
Pspice Introduction
Pspice IntroductionPspice Introduction
Pspice IntroductionAkshay Dhole
 
Arduino Introduction (Blinking LED) Presentation (workshop #5)
Arduino  Introduction (Blinking LED)  Presentation (workshop #5)Arduino  Introduction (Blinking LED)  Presentation (workshop #5)
Arduino Introduction (Blinking LED) Presentation (workshop #5)UNCG University Libraries
 
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: STM32F101Premier Farnell
 
Automation of shopping cart to ease queue in malls by using RFID
Automation of shopping cart to ease queue in malls by using RFIDAutomation of shopping cart to ease queue in malls by using RFID
Automation of shopping cart to ease queue in malls by using RFIDSudher Sun
 
PIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTESPIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTESDr.YNM
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architectureDominicHendry
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt maineddy royappa
 
PIC Microcontrollers.ppt
PIC Microcontrollers.pptPIC Microcontrollers.ppt
PIC Microcontrollers.pptDr.YNM
 
microprocessor-and-microcontroller
microprocessor-and-microcontrollermicroprocessor-and-microcontroller
microprocessor-and-microcontrollerjhcid
 
Basics of open source embedded development board (
Basics of open source embedded development board (Basics of open source embedded development board (
Basics of open source embedded development board (Dhruwank Vankawala
 
Introduction to embedded systems
Introduction  to embedded systemsIntroduction  to embedded systems
Introduction to embedded systemsRAMPRAKASHT1
 

What's hot (20)

Arduino
ArduinoArduino
Arduino
 
RTC Interfacing and Programming
RTC Interfacing and ProgrammingRTC Interfacing and Programming
RTC Interfacing and Programming
 
Heart rate monitoring system using arduino
Heart rate monitoring system using  arduinoHeart rate monitoring system using  arduino
Heart rate monitoring system using arduino
 
Pspice Introduction
Pspice IntroductionPspice Introduction
Pspice Introduction
 
ARM CORTEX M3 PPT
ARM CORTEX M3 PPTARM CORTEX M3 PPT
ARM CORTEX M3 PPT
 
Avr introduction
Avr introductionAvr introduction
Avr introduction
 
Arduino Introduction (Blinking LED) Presentation (workshop #5)
Arduino  Introduction (Blinking LED)  Presentation (workshop #5)Arduino  Introduction (Blinking LED)  Presentation (workshop #5)
Arduino Introduction (Blinking LED) Presentation (workshop #5)
 
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
 
Automation of shopping cart to ease queue in malls by using RFID
Automation of shopping cart to ease queue in malls by using RFIDAutomation of shopping cart to ease queue in malls by using RFID
Automation of shopping cart to ease queue in malls by using RFID
 
PIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTESPIC MICROCONTROLLERS -CLASS NOTES
PIC MICROCONTROLLERS -CLASS NOTES
 
Pic microcontroller architecture
Pic microcontroller architecturePic microcontroller architecture
Pic microcontroller architecture
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
 
Arduino
ArduinoArduino
Arduino
 
PIC Microcontrollers.ppt
PIC Microcontrollers.pptPIC Microcontrollers.ppt
PIC Microcontrollers.ppt
 
microprocessor-and-microcontroller
microprocessor-and-microcontrollermicroprocessor-and-microcontroller
microprocessor-and-microcontroller
 
Case study of digital camera
Case study of digital cameraCase study of digital camera
Case study of digital camera
 
Basics of open source embedded development board (
Basics of open source embedded development board (Basics of open source embedded development board (
Basics of open source embedded development board (
 
PIC Microcontroller | ADC Interfacing
PIC Microcontroller | ADC InterfacingPIC Microcontroller | ADC Interfacing
PIC Microcontroller | ADC Interfacing
 
ARM Architecture
ARM ArchitectureARM Architecture
ARM Architecture
 
Introduction to embedded systems
Introduction  to embedded systemsIntroduction  to embedded systems
Introduction to embedded systems
 

Similar to ATmega328p (20)

Atmega 8
Atmega 8Atmega 8
Atmega 8
 
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
 
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
 
Atmega16 datasheet
Atmega16 datasheetAtmega16 datasheet
Atmega16 datasheet
 
Atmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheetAtmega16 Microconntroller Data sheet
Atmega16 Microconntroller Data sheet
 
A tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data SheetA tmega16A Microcontroller Data Sheet
A tmega16A Microcontroller Data Sheet
 
Atmega 32
Atmega 32Atmega 32
Atmega 32
 
Atemega saya
Atemega sayaAtemega saya
Atemega saya
 
Atmel 8271-8-bit-avr-microcontroller-a tmega48-a-48pa-88a-88pa-168a-168pa-328...
Atmel 8271-8-bit-avr-microcontroller-a tmega48-a-48pa-88a-88pa-168a-168pa-328...Atmel 8271-8-bit-avr-microcontroller-a tmega48-a-48pa-88a-88pa-168a-168pa-328...
Atmel 8271-8-bit-avr-microcontroller-a tmega48-a-48pa-88a-88pa-168a-168pa-328...
 
Doc2502
Doc2502Doc2502
Doc2502
 
8051 Presentation
8051 Presentation8051 Presentation
8051 Presentation
 
5. Features of the LPC214X Family.pptx
5. Features of the LPC214X Family.pptx5. Features of the LPC214X Family.pptx
5. Features of the LPC214X Family.pptx
 
89c5131datasheet
89c5131datasheet89c5131datasheet
89c5131datasheet
 
Datasheet 89S8253.pdf
Datasheet 89S8253.pdfDatasheet 89S8253.pdf
Datasheet 89S8253.pdf
 
2502s
2502s2502s
2502s
 
2 unit-es-printed
2 unit-es-printed2 unit-es-printed
2 unit-es-printed
 
Meta88full
Meta88fullMeta88full
Meta88full
 
At89s51
At89s51At89s51
At89s51
 

Recently uploaded

How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17Celine George
 
Keeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesKeeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesTechSoup
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTechSoup
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...Denish Jangid
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleCeline George
 
size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticspragatimahajan3
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPCeline George
 
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya - UEM Kolkata Quiz Club
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxCapitolTechU
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxShibin Azad
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxJenilouCasareno
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersPedroFerreira53928
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...Nguyen Thanh Tu Collection
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfbu07226
 
Application of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesApplication of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesRased Khan
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointELaRue0
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
 

Recently uploaded (20)

How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17
 
Keeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesKeeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security Services
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceutics
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
 
Application of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesApplication of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matrices
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPoint
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 

ATmega328p

  • 1. https://technoelectronics44.blogspot.com/202 0/08/atmega-328p.html What is ATMEGA-328P The ATmega328 is a single-chip microcontroller created by Atmel with inside the megaAVR family, later Microchip Technology acquired Atmel in 2016. The alternative to the ATMEGA328 is “Pico power” MCU (ATMEGA328P)  ATMEGAp-328  ATMEGA-328p  ATMEGA-328PB, ATMEGA-328PB(AUTOMOTIVE)-advance to the ATMEGA-328P(more UART, SPI, Memory...) ATMEGA-328P-TQFP
  • 2. ATMEGA-328P-PU DIP USER MANUAL: User manual Technical specifications ATMEGA-328P Processor 8-Bit AVR-RISC External Oscillator 16Mhz Architecture Harvard Flash memory type Enabled Flash memory 32kb EEPROM 1Kb SRAM 2kb ADC 10-bit (6 channels) Performance 1 MIPS per 1 MHZ Write/erase cycles flash =10,000 EEPROM=100,000 Timers 2-8bit, 1-16bit Timers Pins 28(DIP),32(TQFP) Operating voltage 2.7v to 5.5v Operating temperature -40 ͦC to +125 ͦC.
  • 3. PWM channels 6 Communication 1-UART, 2-SPI, 1-I2C Internal RC oscillator 8MHZ I/O pin current ratings 40ma Pin Description: ATMEGA328P-28pin It has a total of 28 pins, each pin will perform multiple functionalities, based on the pin functionalities we can describe as follows. ATMEGA-328P Pin diagram GPIO pins: General purpose input-output pins It has three ports PORT-B, PORT-C, PORT-D. PORT-B has eight pins from PB0- PB7, PORT-C has seven pins from PC0-PC6 and PORT-D has eight pins from PD0- PD7. Every pin can work as a digital I/O pin. If you want to use these pins as input or output you need to configure them using the program, otherwise, some error readings will obtain.
  • 4. PORT-B =PB0, PB1, PB2,PB3, PB4,PB5,PB6,PB7. PORT-C =PC0, PC1, PC2,PC3, PC4,PC5,PC6. PORT-D =PD0,PD1, PD2,PD3,PD4,PD5, PD6,PD7. Communication pins: Serial communication Serial communication supported by ATMEGA328P: 1-UART, 1-I2C, 2-SPI UART: Universal asynchronous receiver transmitter It has one UART communication it has two pins RX, TX  RX (Receive data) –PD0/2  TX (Transmit data)-PD1/3 I2C: Inter-Integrated Circuit.  SCL (Serial Clock) –PC5/28  SDA (Serial Data)-PC4/27
  • 5. SPI: serial peripheral interface  SCK (Clock) –PB5/19  MISO (Master In Slave Out) –PB4/18  MOSI (Master Out Slave IN) –PB3/17  SS (Slave Select) –PB2/16 INTERRUPTS: External interrupts  Interrupts are use full to execute the high priority task.  It has two external interrupts  INT0-External Interrupt Source 0-PD2/4  INT1- External Interrupt Source 1-PD3/5 ADC: Analog to Digital Converter (10-BIT) It has six ADC channels ADC0-PC0/23 ADC1-PC1/24 ADC2-PC2/25 ADC3-PC3/26 ADC4-PC4/27 ADC5-PC5/28 TIMERS: Timer/Counter It has two 16 bit timers  T0-Timer/counter 0-PD4/6  T1- Timer/counter 1-PD5/11 Comparator  AIN0-Analog comparator positive input, configure as an input pin and disable the pullup resistor-PD6/12  AIN1-Analog comparator negative input, configure as an input pin and disable the pullup resistor-PD7/13
  • 6. CLOCK To execute the set of instructions we need to provide the clock source  XTAL1-External clock source pin 0 (Crystal oscillator) used to all chip clock source except internal RC oscillator—PB6/9  XTAL2- External clock source pin 1 (Crystal oscillator)- -PB7/10  CLK0- divides the system clock-PB0/14  TOSC1 –Timer oscillator pin1, used only when the internal clock frequency as chip clock source-PB6/9  TOSC2 –Timer oscillator pin2, used only when the internal clock frequency as chip clock source-PB7/10 PCINT: Pin change Interrupt (PCINT0-PCINT23) Its interesting feature is any of the pins we can configure as an interrupt pin, So we set the functionality of the pin as an interrupt. Capture and PWM channel (OC (Output compare),IC(Input compare)) OC: Output compare match, it provides the external output to the Timer/Counter match output. IC: Input compare pin, it acts as an input capture pin for the corresponding pin.  OC0A-PD6/12  OC0B-PD5/11  OC1A-PB1/15  OC1B-PB2/16  OC2A-PB3/17  OC2B-PD3/5  ICP1-PB0/14 RESET: Reset pin-PC6/1 It is an active LOW state pin, it acts as an input pin when it is programmed it depends on power- on reset and brown-out reset functions. When it is unprogrammed it depends on the input reset circuitry. AREF: Analog reference voltage--21 ARef is the external power supply to the ADC module, by default ADC takes the Vcc (5V) of the controller. If you want to set any customized voltage to ADC module you have to use the ARef pin.
  • 7. AVcc: Analog power pin-20 It is used to activate the ADC operation. POWER: Power supply pins  VCC – 7  GND- 8, 22 HOW TO USE ATMEGA328P If you want to work with any microcontroller you need to remember two things  Hardware setup  Software setup Hardware setup Microcontroller the developing board needs minimum hardware configuration, those are power supply the unit, operating frequency (crystal unit), Reset circuitry and finally, you need to set up a boot loader for the flash program. Software setup To develop any application program you have a compiler or IDE. Download the compiler and install it from core foundry website (MICROCHIP). For ATMEGA328 u have to prefer - ATMEL-STUDIO IDE Download link: CLICK HERE NOTE: For easy purpose go to ARDUINO(ATMEGA 328P) controller. Applications  Embedded products design.  Voltage controller unit  Digital Energy meters  Familiar with the Arduino family. Reference links: