下表是 Pololu 3pi robot 和 Arduino (ATmega328P) pin 腳的使用對照表.
可以發現 3pi 的 AVR 幾乎所有 pin 腳都被用掉了.
如果犧牲掉 LCD 則可空出7 pins, 或者也可以共用的方式使用一些 pins, 只是需要一些巧思.
SPI pins 也被用掉了, 如果要用到 SPI , 這樣程式寫起來真的會比較辛苦.
AVR | 3pi | Arduino 328P | |
PD | 0 |
| Digital 0 (RX) |
1 | LED (RED) | Digital 1 (TX) | |
2 | LCD (RS) | Digital 2 (INT 0) | |
3 | MDRV (AIN 2) | Digital 3 (INT 1) | |
4 | LCD (E) | Digital 4 | |
5 | MDRV (BIN 1) | Digital 5 | |
6 | MDRV (BIN 2) | Digital 6 | |
7 | LCD (DB 7) LED (GREEN) | Digital 7 | |
PB | 0 | LCD (R/W) | Digital 8 |
1 | LCD (DB 4) Button A | Digital 9 | |
2 | BUZZER | Digital 10 (SS) | |
3 | MDRV (AIN 1) | Digital 11 (MOSI) | |
4 | LCD (DB 5) Button B | Digital 12 (MISO) | |
5 | LCD (DB 6) Button C | Digital 13 (SCK) | |
6 | XTAL 1 | XTAL 1 | |
7 | XTAL 2 | XTAL 2 | |
PC | 0 | IRRX 0 | Analog 0 |
1 | IRRX 1 | Analog 1 | |
2 | IRRX 2 | Analog 2 | |
3 | IRRX 3 | Analog 3 | |
4 | IRRX 4 | Analog 4 (SDA) | |
5 | LEDON | Analog 5 (SCL) | |
6 | MDRV (STBY) / RESET | RESET | |
|
|
|
留言列表