ATmega328P Notes
- 32K Flash program memory
- 2K SRAM
- 1K EEPROM
- Two 8-bit Timer/Counters
- One 16-bit Timer/Counter
- Six PWM Channels
- Six channel 10-bit ADC
- One Serial USART
- One Master/Slave SPI Serial Interface
- One 2-wire Serial Interface (Philips I2C compatible)
Links
Timers
With a 16 MHz clock, clockCyclesPerMicrosecond() is
16000000 / 1000000 or 16 clock cycles per microsecond.
- timer0 is 8-bit
used by millis() and micros()
used PWM pins 5 and 6
programmed for 4 µs per count.
- timer1 is 16-bit
used PWM pins 9 and 10
- timer2 is 8-bit
used PWM pins 3 and 11
- serial0
used PWM pins ? and ?
Interrupts
- PCINT0 on d8
- PCINT1 on d9
- PCINT2 on d10
- PCINT3 on d11
- PCINT4 on d12
- PCINT5 on d13
- PCINT6 on d6
- PCINT7 on d7
- PCINT8 on d14
- PCINT9 on d15
- PCINT10 on d16
- PCINT11 on d17
- PCINT12 on d18
- PCINT13 on d19
- PCINT14 on RESET
-
- PCINT16 on d0 (RXD)
- PCINT17 on d1 (TXD)
- PCINT18/INT0 on d2
- PCINT19 on d3
- PCINT20 on d4
- PCINT21 on d5
- PCINT22 on d6
- PCINT23 on d7
ATmega328P
General |
Physical |
Logical |
Function |
Description |
7 |
|
VCC |
|
8 |
|
GND |
|
20 |
|
AVCC |
|
21 |
|
AREF |
|
22 |
|
AGND |
|
Port B |
Physical |
Logical |
Function |
Description |
14 |
d8 |
|
|
15 |
d9 |
PWM |
|
16 |
d10 |
SS |
SPI |
17 |
d11 |
MOSI |
SPI |
18 |
d12 |
MISO |
SPI |
19 |
d13 |
SCK |
SPI |
9 |
|
XTAL1 |
|
10 |
|
XTAL2 |
|
Port C |
Physical |
Logical |
Function |
Description |
23 |
d14 |
a0 |
|
24 |
d15 |
a1 |
|
25 |
d16 |
a2 |
|
26 |
d17 |
a3 |
|
27 |
d18 |
SDA |
TWI |
28 |
d19 |
SCL |
TWI |
1 |
|
RESET |
|
Port D |
Physical |
Logical |
Function |
Description |
2 |
d0 |
RXD |
USART |
3 |
d1 |
TXD |
USART |
4 |
d2 |
INT0 |
|
5 |
d3 |
PWM |
|
6 |
d4 |
|
|
11 |
d5 |
|
|
12 |
d6 |
|
|
13 |
d7 |
|
|
Copyright © 2011, 2012, 2013, 2015, 2017, 2018, 2019, 2020
Craig Leres