This project demonstrates the TWI peripheral in slave mode. It mimics the behavior of a serial memory, enabling the TWI master to read and write data in its internal SRAM.
This package can be used with SAM V71 Xplained Ultra board or SAME70 Xplained board.
After launching the program, the device will act as a simple TWI-enabled serial memory containing 256 bytes. This enables this project to be used with the twi_eeprom project as the master after modifying the slave address AT24MAC_ADDRESS as 0x53 in main.c.
To write in the memory, the TWI master must address the device first, then send one byte containing the memory address to access. Additional bytes are treated as the data to write.
Reading is done in the same fashion, except that after receiving the memory address, the device will start outputting data until a STOP condition is sent by the master.
Please connect the two SAMV71/SAME70 boards with the following pins which could be easily wired from the board.
-- TWI Slave Example xxx -- -- SAMxxxxx-xx -- Compiled: xxx xx xxxx xx:xx:xx -- -I- Configuring the TWI in slave mode
-- TWI EEPROM Example xxx -- -- SAMxxxxx-xx -- Compiled: xxx xx xxxx xx:xx:xx -- -I- Filling page #0 with zeroes ... -I- Filling page #1 with zeroes ... ...... -I- 0 comparison error(s) found ...... -I- 0 comparison error(s) found