HAL I2C loopback interrupt
This example demonstrates how to use the I2C HAL module with interrupt mode to perform a loopback test. The application configures one I2C instance as a controller and another as a target device, then performs a data transfer between them using interrupts to handle the communication events.
Example Usage
Build and Load the example to your device
Run the application and observe the output in the terminal
The application will initialize the I2C HAL with interrupt mode
The controller will send data to the target address (0x50)
The target will receive the data and send a response
The application will verify successful data transmission and reception
This example demonstrates:
I2C HAL initialization for both controller and target modes
Configuring I2C interrupts
Using SPGSS loopback for internal testing
Handling HAL based I2C communication with interrupt-driven transfers
External Connections
This example uses an internal loopback configuration via the SPGSS module. No external connections are required as the loopback is configured through software:
UC2 is configured as the I2C controller
UC1 is configured as the I2C target
SPG0 provides the loopback connection between these instances