Difference between revisions of "ATMega pinout"

From ZeroPhone
Jump to: navigation, search
(Created page with "{| class="wikitable floatright" |- ! scope="col"| Legend |- | style="background-color: red;text-align:center" | 3.3V Power |- | style="background-color: fuchsia;text-align:cen...")
 
Line 24: Line 24:
 
|-
 
|-
 
! scope="col"| Pin Number
 
! scope="col"| Pin Number
! scope="col"| Pin name
+
! scope="col"| ATMega pin
 +
! scope="col"| Arduino pin
 
! scope="col"| Function
 
! scope="col"| Function
! scope="col"| Used For
+
! scope="col"| Used for
 +
! scope="col"| Firmware support
 
|-
 
|-
| style="text-align:right;background-color: red;" | 1
+
| style="text-align:right;background-color: yellow;" | 1
| style="background-color: red;" | 3V3
+
| style="background-color: yellow;" | PD3
| style="background-color: red;" | 3V3
+
| style="background-color: yellow;" |
| style="background-color: red;" | Power for ESP8266/display
+
| style="background-color: yellow;" | COL5
 +
| style="background-color: yellow;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: fuchsia" | 2
+
| style="text-align:right;background-color: yellow;" | 2
| style="background-color: fuchsia;" | VSYS
+
| style="background-color: yellow;" | PD4
| style="background-color: fuchsia;" | VSYS
+
| style="background-color: yellow;" |
| style="background-color: fuchsia;" | VSYS in, VBAT sensing with ATMega
+
| style="background-color: yellow;" | COL4
 +
| style="background-color: yellow;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: orange" | 3
+
| style="text-align:right;background-color: red;" | #3
| style="background-color: orange;" | GPIO2
+
| style="background-color: red;" | PD3
| style="background-color: orange;" | SDA
+
| style="background-color: red;" |  
| style="background-color: orange;" | I2C - ATMega, MCP23017, expansion header, testpoints
+
| style="background-color: red;" | COL5
 +
| style="background-color: red;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: fuchsia" | 4
+
| style="text-align:right;background-color: red;" | #4
| style="background-color: fuchsia;" | VSYS
+
| style="background-color: red;" | PD3
| style="background-color: fuchsia;" | VSYS
+
| style="background-color: red;" |
| style="background-color: fuchsia;" | VSYS in, VSYS sensing with ATMega
+
| style="background-color: red;" | COL5
 +
| style="background-color: red;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: orange" | 5
+
| style="text-align:right;background-color: red;" | #5
| style="background-color: orange;" | GPIO3
+
| style="background-color: red;" | PD3
| style="background-color: orange;" | SCL
+
| style="background-color: red;" |  
| style="background-color: orange;" | I2C - ATMega, MCP23017, expansion header, testpoints
+
| style="background-color: red;" | COL5
 +
| style="background-color: red;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="color: white;text-align:right;background-color: black" | 6
+
| style="text-align:right;background-color: red;" | #6
| style="color: white;background-color: black;" | GND
+
| style="background-color: red;" | PD3
| style="color: white;background-color: black;" | GND
+
| style="background-color: red;" |  
| style="color: white;background-color: black;" | Ground
+
| style="background-color: red;" | COL5
 +
| style="background-color: red;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: aqua" | 7
+
| style="text-align:right;background-color: red;" | 7
| style="background-color: aqua;" | GPIO4
+
| style="background-color: red;" | PB6
| style="background-color: aqua;" | GPIO
+
| style="background-color: red;" | X
| style="background-color: aqua;" | IR TX
+
| style="background-color: red;" | XTAL1
 +
| style="background-color: red;" | 16MHz crystal connection
 +
| style="background-color: red;" |  
 
|-
 
|-
| style="text-align:right;background-color: orange" | 8
+
| style="text-align:right;background-color: red;" | 8
| style="background-color: orange;" | GPIO14
+
| style="background-color: red;" | PB7
| style="background-color: orange;" | RXD
+
| style="background-color: red;" | X
| style="background-color: orange;" | GSM UART TXD
+
| style="background-color: red;" | XTAL2
 +
| style="background-color: red;" | 16MHz crystal connection
 +
| style="background-color: red;" |  
 
|-
 
|-
| style="color: white;text-align:right;background-color: black" | 9
+
| style="text-align:right;background-color: yellow;" | 9
| style="color: white;background-color: black;" | GND
+
| style="background-color: yellow;" | PD5
| style="color: white;background-color: black;" | GND
+
| style="background-color: yellow;" |  
| style="color: white;background-color: black;" | Ground
+
| style="background-color: yellow;" | ATMEGA_GPIO
 +
| style="background-color: yellow;" | User-exposed (opt-in)
 +
| style="background-color: red;" | No
 
|-
 
|-
| style="text-align:right;background-color: orange" | 10
+
| style="text-align:right;background-color: yellow;" | 10
| style="background-color: orange;" | GPIO15
+
| style="background-color: yellow;" | PD6
| style="background-color: orange;" | TXD
+
| style="background-color: yellow;" |
| style="background-color: orange;" | GSM UART RXD
+
| style="background-color: yellow;" | COL3
 +
| style="background-color: yellow;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: aqua" | 11
+
| style="text-align:right;background-color: yellow;" | 11
| style="background-color: aqua;" | GPIO17
+
| style="background-color: yellow;" | PD7
| style="background-color: aqua;" | GPIO
+
| style="background-color: yellow;" |
| style="background-color: aqua;" | Expansion header / SPI1 / IR RX
+
| style="background-color: yellow;" | COL2
 +
| style="background-color: yellow;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: aqua" | 12
+
| style="text-align:right;background-color: yellow;" | 12
| style="background-color: aqua;" | GPIO18
+
| style="background-color: yellow;" | PB0
| style="background-color: aqua;" | GPIO
+
| style="background-color: yellow;" |
| style="background-color: aqua;" | Expansion Header / I2S / SPI1
+
| style="background-color: yellow;" | COL1
 +
| style="background-color: yellow;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: lime" | 13
+
| style="text-align:right;background-color: red;" | 13
| style="background-color: lime;" | GPIO27
+
| style="background-color: red;" | PB1
| style="background-color: lime;" | SD_D3
+
| style="background-color: red;" |  
| style="background-color: lime;" | ESP8266 SDIO pin / ESP-socket GPIO expansion
+
| style="background-color: red;" | KEYPAD_BL
 +
| style="background-color: red;" | Keypad backlight
 +
| style="background-color: red;" | No
 
|-
 
|-
| style="color: white;text-align:right;background-color: black" | 14
+
| style="text-align:right;background-color: red;" | 14
| style="color: white;background-color: black;" | GND
+
| style="background-color: red;" | PB2
| style="color: white;background-color: black;" | GND
+
| style="background-color: red;" |  
| style="color: white;background-color: black;" | Ground
+
| style="background-color: red;" | DISPLAY_BL
 +
| style="background-color: red;" | Display backlight (i.e. TFT)
 +
| style="background-color: red;" | No
 
|-
 
|-
| style="background-color: lime;text-align:right;" | 15
+
| style="text-align:right;background-color: red;" | 15
| style="background-color: lime;" | GPIO22
+
| style="background-color: red;" | PB3
| style="background-color: lime;" | SD_CLK
+
| style="background-color: red;" |  
| style="background-color: lime;" | ESP8266 SDIO pin / ESP-socket GPIO expansion
+
| style="background-color: red;" | VIBRO_PWM
 +
| style="background-color: red;" | Vibromotor control
 +
| style="background-color: red;" | Experimental FW
 
|-
 
|-
| style="background-color: lime;text-align:right;" | 16
+
| style="text-align:right;background-color: yellow;" | 16
| style="background-color: lime;" | GPIO23
+
| style="background-color: yellow;" | PB4
| style="background-color: lime;" | SD_CMD
+
| style="background-color: yellow;" |  
| style="background-color: lime;" | IESP8266 SDIO pin / ESP-socket GPIO expansion
+
| style="background-color: yellow;" | ROW1
 +
| style="background-color: yellow;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="background-color: red;text-align:right;" | 17
+
| style="text-align:right;background-color: yellow;" | 17
| style="background-color: red;" | 3V3
+
| style="background-color: yellow;" | PB5
| style="background-color: red;" | 3V3
+
| style="background-color: yellow;" |  
| style="background-color: red;" | Power for ATMega
+
| style="background-color: yellow;" | ROW2
 +
| style="background-color: yellow;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="background-color: lime;text-align:right;" | 18
+
| style="text-align:right;background-color: red;" | #18
| style="background-color: lime;" | GPIO24
+
| style="background-color: red;" | PD3
| style="background-color: lime;" | SD_D0
+
| style="background-color: red;" |  
| style="background-color: lime;" | ESP8266 SDIO pin / ESP-socket GPIO expansion
+
| style="background-color: red;" | COL5
 +
| style="background-color: red;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="color: white;text-align:right;background-color: blue" | 19
+
| style="text-align:right;background-color: red;" | #19
| style="color: white;background-color: blue;" | GPIO10
+
| style="background-color: red;" | PD3
| style="color: white;background-color: blue;" | SPI_MOSI
+
| style="background-color: red;" |  
| style="color: white;background-color: blue;" | Display SPI interface, expansion header
+
| style="background-color: red;" | COL5
 +
| style="background-color: red;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="color: white;text-align:right;background-color: black" | 20
+
| style="text-align:right;background-color: red;" | #20
| style="color: white;background-color: black;" | GND
+
| style="background-color: red;" | PD3
| style="color: white;background-color: black;" | GND
+
| style="background-color: red;" |  
| style="color: white;background-color: black;" | Ground
+
| style="background-color: red;" | COL5
 +
| style="background-color: red;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: aqua" | 21
+
| style="text-align:right;background-color: red;" | #21
| style="background-color: aqua;" | GPIO9
+
| style="background-color: red;" | PD3
| style="background-color: aqua;" | SPI_MISO
+
| style="background-color: red;" |  
| style="background-color: aqua;" | Expansion header - SPI
+
| style="background-color: red;" | COL5
 +
| style="background-color: red;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: lime" | 22
+
| style="text-align:right;background-color: red;" | #22
| style="background-color: lime;" | GPIO25
+
| style="background-color: red;" | PD3
| style="background-color: lime;" | SD_D1
+
| style="background-color: red;" |  
| style="background-color: lime;" | ESP8266 SDIO pin / ESP-socket GPIO expansion
+
| style="background-color: red;" | COL5
 +
| style="background-color: red;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="color: white;text-align:right;background-color: blue" | 23
+
| style="text-align:right;background-color: yellow;" | 23
| style="color: white;background-color: blue;" | GPIO11
+
| style="background-color: yellow;" | PC0
| style="color: white;background-color: blue;" | SCK
+
| style="background-color: yellow;" |  
| style="color: white;background-color: blue;" | Display SPI interface, expansion header
+
| style="background-color: yellow;" | ROW3
 +
| style="background-color: yellow;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="color: white;text-align:right;background-color: blue" | 24
+
| style="text-align:right;background-color: yellow;" | 24
| style="color: white;background-color: blue;" | GPIO8
+
| style="background-color: yellow;" | PC1
| style="color: white;background-color: blue;" | SPI_CSO
+
| style="background-color: yellow;" |  
| style="color: white;background-color: blue;" | Display SPI interface
+
| style="background-color: yellow;" | ROW4
 +
| style="background-color: yellow;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="color: white;text-align:right;background-color: black" | 25
+
| style="text-align:right;background-color: yellow;" | 25
| style="color: white;background-color: black;" | GND
+
| style="background-color: yellow;" | PC2
| style="color: white;background-color: black;" | GND
+
| style="background-color: yellow;" |  
| style="color: white;background-color: black;" | Ground
+
| style="background-color: yellow;" | ROW5
 +
| style="background-color: yellow;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: aqua" | 26
+
| style="text-align:right;background-color: red;" | 26
| style="background-color: aqua;" | GPIO7
+
| style="background-color: red;" | PC3
| style="background-color: aqua;" | SPI_CS1
+
| style="background-color: red;" |  
| style="background-color: aqua;" | Expansion header - SPI
+
| style="background-color: red;" | KEYPAD_INT
 +
| style="background-color: red;" | Pi Zero communication
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: lime" | 27
+
| style="text-align:right;background-color: red;" | 27
| style="background-color: lime;" | GPIO0
+
| style="background-color: red;" | PC4
| style="background-color: lime;" | SD_RST
+
| style="background-color: red;" |  
| style="background-color: lime;" | EEPROM SDA / ESP8266 RESET pin / ESP-socket GPIO expansion
+
| style="background-color: red;" | SDA
 +
| style="background-color: red;" | Pi Zero communication
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="text-align:right;background-color: orange" | 28
+
| style="text-align:right;background-color: red;" | 28
| style="background-color: orange;" | GPIO1
+
| style="background-color: red;" | PC5
| style="background-color: orange;" | MCP_INT
+
| style="background-color: red;" |  
| style="background-color: orange;" | EEPROM SCL / MCP23017 interrupt pin
+
| style="background-color: red;" | SCL
 +
| style="background-color: red;" | Pi Zero communication
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="color: white;text-align:right;background-color: blue" | 29
+
| style="text-align:right;background-color: yellow;" | 29
| style="color: white;background-color: blue;" | GPIO5
+
| style="background-color: yellow;" | PC6
| style="color: white;background-color: blue;" | DP_RST
+
| style="background-color: yellow;" |  
| style="color: white;background-color: blue;" | Keypad GPIO / Display SPI interface
+
| style="background-color: yellow;" | COL5
 +
| style="background-color: yellow;" | Keypad scanning
 +
| style="background-color: red;" | Yes
 
|-
 
|-
| style="color: white;text-align:right;background-color: black" | 30
+
| style="text-align:right;background-color: red;" | 30
| style="color: white;background-color: black;" | GND
+
| style="background-color: red;" | PD0
| style="color: white;background-color: black;" | GND
+
| style="background-color: red;" |  
| style="color: white;background-color: black;" | Ground
+
| style="background-color: red;" | ATMEGA_RXD
 +
| style="background-color: red;" | User-exposed; programming
 +
| style="background-color: red;" | No
 
|-
 
|-
| style="color: white;text-align:right;background-color: blue" | 31
+
| style="text-align:right;background-color: red;" | 31
| style="color: white;background-color: blue;" | GPIO6
+
| style="background-color: red;" | PD1
| style="color: white;background-color: blue;" | DP_DC
+
| style="background-color: red;" |  
| style="color: white;background-color: blue;" | Display SPI interface
+
| style="background-color: red;" | ATMEGA_TXD
 +
| style="background-color: red;" | User-exposed; programming
 +
| style="background-color: red;" | No
 
|-
 
|-
| style="text-align:right;background-color: yellow" | 32
+
| style="text-align:right;background-color: yellow;" | 32
| style="background-color: yellow;" | GPIO12
+
| style="background-color: yellow;" | PD2
| style="background-color: yellow;" | AUDIO_0
+
| style="background-color: yellow;" |  
| style="background-color: yellow;" | PWM audio
+
| style="background-color: yellow;" | COL6
|-
+
| style="background-color: yellow;" | Keypad scanning
| style="text-align:right;background-color: yellow" | 33
+
| style="background-color: red;" | Yes
| style="background-color: yellow;" | GPIO13
 
| style="background-color: yellow;" | AUDIO_1
 
| style="background-color: yellow;" | PWM audio
 
|-
 
| style="color: white;text-align:right;background-color: black" | 34
 
| style="color: white;background-color: black;" | GND
 
| style="color: white;background-color: black;" | GND
 
| style="color: white;background-color: black;" | Ground
 
|-
 
| style="text-align:right;background-color: aqua" | 35
 
| style="background-color: aqua;" | GPIO19
 
| style="background-color: aqua;" | GPIO
 
| style="background-color: aqua;" | Expansion header / I2S / SPI1
 
|-
 
| style="text-align:right;background-color: orange" | 36
 
| style="background-color: orange;" | GPIO16
 
| style="background-color: orange;" | KEYPAD_INT
 
| style="background-color: orange;" | ATMega328p interrupt pin
 
|-
 
| style="text-align:right;background-color: lime" | 37
 
| style="background-color: lime;" | GPIO26
 
| style="background-color: lime;" | SD_D2
 
| style="background-color: lime;" | ESP8266 SDIO pin / ESP-socket GPIO expansion
 
|-
 
| style="text-align:right;background-color: aqua" | 38
 
| style="background-color: aqua;" | GPIO20
 
| style="background-color: aqua;" | GPIO
 
| style="background-color: aqua;" | Expansion header / I2S / SPI1
 
|-
 
| style="color: white;text-align:right;background-color: black" | 39
 
| style="color: white;background-color: black;" | GND
 
| style="color: white; background-color: black;" | GND
 
| style="color: white;background-color: black;" | Ground
 
|-
 
| style="text-align:right;background-color: aqua" | 40
 
| style="background-color: aqua;" | GPIO21
 
| style="background-color: aqua;" | GPIO
 
| style="background-color: aqua;" | Expansion header /I2S / SPI1
 
 
|}
 
|}

Revision as of 22:52, 10 January 2019

Legend
3.3V Power
3.5V-5V power
GND
Keypad matrix pins
User-exposed pins
Auxiliary functions
Pi Zero-connected pins
ATMega, MCP23017 and GSM connections


Pin Number ATMega pin Arduino pin Function Used for Firmware support
1 PD3 COL5 Keypad scanning Yes
2 PD4 COL4 Keypad scanning Yes
#3 PD3 COL5 Keypad scanning Yes
#4 PD3 COL5 Keypad scanning Yes
#5 PD3 COL5 Keypad scanning Yes
#6 PD3 COL5 Keypad scanning Yes
7 PB6 X XTAL1 16MHz crystal connection
8 PB7 X XTAL2 16MHz crystal connection
9 PD5 ATMEGA_GPIO User-exposed (opt-in) No
10 PD6 COL3 Keypad scanning Yes
11 PD7 COL2 Keypad scanning Yes
12 PB0 COL1 Keypad scanning Yes
13 PB1 KEYPAD_BL Keypad backlight No
14 PB2 DISPLAY_BL Display backlight (i.e. TFT) No
15 PB3 VIBRO_PWM Vibromotor control Experimental FW
16 PB4 ROW1 Keypad scanning Yes
17 PB5 ROW2 Keypad scanning Yes
#18 PD3 COL5 Keypad scanning Yes
#19 PD3 COL5 Keypad scanning Yes
#20 PD3 COL5 Keypad scanning Yes
#21 PD3 COL5 Keypad scanning Yes
#22 PD3 COL5 Keypad scanning Yes
23 PC0 ROW3 Keypad scanning Yes
24 PC1 ROW4 Keypad scanning Yes
25 PC2 ROW5 Keypad scanning Yes
26 PC3 KEYPAD_INT Pi Zero communication Yes
27 PC4 SDA Pi Zero communication Yes
28 PC5 SCL Pi Zero communication Yes
29 PC6 COL5 Keypad scanning Yes
30 PD0 ATMEGA_RXD User-exposed; programming No
31 PD1 ATMEGA_TXD User-exposed; programming No
32 PD2 COL6 Keypad scanning Yes