User Guide
GD32E230C-EVAL
17 /24
comparing two input voltage, if output level is high, LED2 is off, otherwise LED2 is off.
5.9. I2C_EEPROM
5.9.1. DEMO Purpose
This Demo includes the following functions of GD32 MCU:
Learn how to use the master transmitting mode of the I2C module
Learn how to use the master receiving mode of the I2C module
Learn to read and write the EEPROM with the I2C interface
5.9.2. DEMO Running Result
Download the program <09_I2C_EEPROM> to the EVAL board and run. Connect serial
cable to COM, and open the HyperTerminal to show the print message.
Firstly, the data of 256 bytes will be written to the EEPROM from the address 0x00 and
printed by the serial port. Then, reading the EEPROM from address 0x00 for 256 bytes
and the result will be printed. Finally, compare the data that were written to the EEPROM
and the data that were read from the EEPROM. If they are the same, the serial port will
output "I2C-AT24C02 test passed!" and the four LEDs lights flashing, otherwise the
serial port will output "Err: data read and write aren't matching." and all the four LEDs
light.
The output information via the serial port is as following.