Port the tobyjaffey's bus-ninja to ATmega324PB Xplained Pro board.
- Hardware I2C (default 100kHz, up to 400kHz)
- I2C address scanner ('s' command from i2c mode)
- SPI (default 500kHz, up to 4mHz@3.3V, 8MHz@5V)
- PWM
- GPIO
- ADC
Default baud rate: 1Mbps@8Mhz SYS_CLK
Function | ATmega324PB Pin |
---|---|
SPI CLK | PORTB7 |
SPI MISO | PORTB6 |
SPI MOSI | PORTB5 |
SPI CS | PORTB |
LED | PORTC7 |
[ Chip select (CS) active (low).
{ CS active (low), show the SPI read byte after every write.
] or } CS disable (high).
r Read one byte by sending dummy byte (0xff). (r:1…255 for bulk reads)
0b Write this binary value. Format is 0b00000000 for a byte, but partial bytes are also fine: 0b1001.
0x Write this HEX value. Format is 0×01. Partial bytes are fine: 0xA. A-F can be lower-case or capital letters.
0-255 Write this decimal value. Any number not preceded by 0x or 0b is interpreted as a decimal value.
> spi
> [0x40 0x0A 0x28]
CS ENABLED
WRITE: 0x40
WRITE: 0x0A
WRITE: 0x28
CS DISABLED
> [0x40 r]
CS ENABLED
WRITE: 0x40
READ: 0x00
CS DISABLED
> {0x40 r:2}
CS ENABLED
WRITE: 0x40
READ: 0x00
READ: 0x01
READ: 0x02
CS DISABLED
Function | ATmega324PB Pin |
---|---|
I2C SDA | PORTE5 |
I2C SCL | PORTE6 |
{ or [ Issue I2C start condition.
] or } Issue I2C stop condition.
r Read one byte, send ACK. (r:1…255 for bulk reads)
s I2C address scanner
0b Write this binary value, check ACK. Format is 0b00000000 for a byte, but partial bytes are also fine: 0b1001.
0x Write this HEX value, check ACK. Format is 0×01. Partial bytes are fine: 0xA. A-F can be lower-case or capital letters.
0-255 Write this decimal value, check ACK. Any number not preceded by 0x or 0b is interpreted as a decimal value.