The application demonstrates how to use use the SAM TWIS peripheral.
This package can be used with SAM4L boards.
In addition, another device will be needed to act as the TWI master. The twim_example can be used for that, in which case a second kit supported by that project is needed.
After launching the program, the device will act as a simple TWI-enabled serial memory containing 50 bytes. This enables this project to be used with the twim_example project as the master.
To write in the memory, the TWI master must address the device first, then send two bytes 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. The default address for the TWI slave is fixed to 0x50. If the board has a TWI component with this address, you can change the define TARGET_ADDRESS in conf_example.h of twim_example project, and the define SLAVE_ADDRESS in twi_slave_example.c of twi_slave_exmaple project.
This software was written for the GNU GCC and IAR EWARM. Other compilers may or may not work.
For further information, visit Microchip.
Support and FAQ: https://www.microchip.com/support/