Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Specifications  





2 Features  





3 Family  





4 Applications  





5 Programming  





6 See also  





7 References  





8 External links  














ATmega328






Čeština
Español
Magyar
Português
Română

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


ATmega328P in 28-pin narrow dual in-line package (DIP-28N)
ATmega328P in 32-pin thin quad flat pack (TQFP-32)
Die of ATmega328P

The ATmega328 is a single-chip microcontroller created by Atmel in the megaAVR family (later Microchip Technology acquired Atmel in 2016). It has a modified Harvard architecture 8-bit RISC processor core.

Specifications

[edit]

The Atmel 8-bit AVR RISC-based microcontroller combines 32 KBISP flash memory with read-while-write capabilities, 1 KBEEPROM, 2 KBSRAM, 23 general-purpose I/O lines, 32 general-purpose working registers, 3 flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, a byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D converter (8 channels in TQFP and QFN/MLF packages), programmable watchdog timer with internal oscillator, and 5 software-selectable power-saving modes. The device operates between 1.8 and 5.5 volts. The device achieves throughput approaching 1 MIPS/MHz.[1]

Features

[edit]
Parameter Value
CPU type 8-bit AVR
Maximum CPU speed 20MHz
Performance 20MIPS at 20 MHz[2]
Flash memory 32 KB
SRAM 2 KB
EEPROM 1 KB
Package pin count 28 or 32
Capacitive touch sensing channels 16
Maximum I/O pins 23
External interrupts 3
USB interface No

Family

[edit]

A common alternative to the ATmega328 is the "picoPower" ATmega328P. A comprehensive list of all other members of the megaAVR series can be found on the Atmel website.[3]

Applications

[edit]

ATmega328 is commonly used in many projects and autonomous systems where a simple, low-powered, low-cost micro-controller is needed. Perhaps the most common implementation of this chip is on the popular Arduino development platform, namely the Arduino Uno, Arduino Pro Mini[4] and Arduino Nano models.

Programming

[edit]
Pinout of ATmega 48A/PA/88A/PA/168A/PA/328/P in 28-PDIP (datasheet)

Reliability qualification shows that the projected data retention failure rate is much less than 1PPM over 20 years at 85 °C or 100 years at 25 °C.[5]

Parallel program mode[2]
Programming signal Pin Name I/O Function
RDY/BSY PD1 O High means the MCU is ready for a new command, otherwise busy.
OE PD2 I Output enable (active low)
WR PD3 I Write pulse (active low)
BS1 PD4 I Byte select 1 ("0" = Low byte, "1" = High byte)
XA0 PD5 I XTAL action bit 0
XA1 PD6 I XTAL action bit 1
PAGEL PD7 I Program memory and EEPROM data page load
BS2 PC2 I Byte select 2 ("0" = low byte, "1" = 2nd high byte)
DATA PC[1:0]:PB[5:0] I/O Bi-directional data bus (output when OE is low)

Programming mode is entered when PAGEL (PD7), XA1 (PD6), XA0 (PD5), BS1 (PD4) is set to zero.[2] RESET pin to 0 V and VCC to 0 V. VCC is set to 4.5–5.5 V. Wait 60 μs, and RESET is set to 11.5–12.5 V. Wait more than 310 μs.[2] Set XA1:XA0:BS1:DATA = 100 1000 0000, pulse XTAL1 for at least 150 ns, pulse WR to zero. This starts the chip erase. Wait until RDY/BSY (PD1) goes high. XA1:XA0:BS1:DATA = 100 0001 0000, XTAL1 pulse, pulse WR to zero. This is the flash write command.[2] And so on.

Serial programming[2]
Symbol Pins I/O Description
MOSI PB3 I Serial data in
MISO PB4 O Serial Data out
SCK PB5 I Serial Clock

Serial data to the MCU is clocked on the rising edge and data from the MCU is clocked on the falling edge. Power is applied to VCC while RESET and SCK are set to zero. Wait for at least 20 ms and then the programming enable serial instruction 0xAC, 0x53, 0x00, 0x00 is sent to the MOSI pin. The second byte (0x53) will be echoed back by the MCU.[2]

See also

[edit]

References

[edit]
  1. ^ "ATmega328P". Retrieved 2016-07-14.
  • ^ a b c d e f g "Atmel 8-bit AVR Microcontrollers ATmega328/P Datasheet Complete" (PDF). Retrieved 2016-07-14.
  • ^ "megaAVR Microcontrollers". Atmel. Retrieved 2016-07-14.
  • ^ "Arduino - ArduinoBoardProMini". www.arduino.cc. Retrieved 2021-12-08.
  • ^ "Atmel 8-bit AVR Microcontrollers ATmega328/P Datasheet Summary" (PDF). June 2016. Retrieved 2016-07-14.
  • [edit]
    Official webpages

    Retrieved from "https://en.wikipedia.org/w/index.php?title=ATmega328&oldid=1223713592"

    Category: 
    Atmel microcontrollers
    Hidden categories: 
    Articles with short description
    Short description is different from Wikidata
     



    This page was last edited on 13 May 2024, at 21:41 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki