This example demonstrates how to use the following two drivers:
On the slave, EEPROM memory is simulated. The size of the simulated EEPROM is configurable in the config.h
file. Default memory value of the device is 320 bytes. It is simulated using internal RAM. This RAM area is accessed only by the simulated EEPROM so the rest of the application can access it only by using TWI commands through hardware configured pins.
The selected memory chip has a 7-bit address constant. During a write operation, a word is selected to access the memory. The first byte sent is used as the current address pointer.
During a single access, the entire memory can be read and a maximum of an 8-byte page can be written.
The following are the differences between the actual chip and the simulated chip:
The master communicates with the EEPROM memory and additonally has read and write access. Simple UART commands can be used to check the memory.
Pins to short (see config.h file example directory):
In order to list all commands, press the Tab button.
You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\peripheral\twi_master_with_twis_slave
Test the TWIS slave and TWI master mode drivers example application by performing the following steps:
eeprom read
command to read data from the simulated EEPROM.eeprom write
command with "any string".eeprom read
command again and check whether your string is at the beginning of the memory.eeprom clear
command to clear EEPROM.eeprom read
command again and see if all values are 0xff.eeprom error
command to check transmission error.