Friday, November 28, 2014

I2C Module Experiment on EK-TM4C123GXL

I played with I2C modules on EK-TM4C123GXL. One I2C module (I2C0) is set up as I2C slave. Another I2C module (I2C1) is set up as I2C master for debugging. UART is also used to communicate with PC.

You can download my project files from here.

Here's the block diagram.
The register, created on memory, stores 128 of 8-bit values. I2C master can read/write the registers via I2C bus.

You may manipulate the registers via terminal (Virtual COM port on USB-UART) using commands regr and regw. When the command is executed successfully, the message "OK" is returned.
regr [register address]
regw [register address] [value to be written]
 Also, you may use I2C master using command i2cr and i2cw.
i2cr [slave address] [register address]
i2cw [slave address] [register address] [value to be written]
Default slave address in my code is 0x0c. When the command is executed successfully, the message "OK" is returned.

This is an sample operation with I2C1 master module.



No comments:

Post a Comment