Example 1: Writing to GPIO_Output Register
(Address 0x02)
Goal: Set GPIO outputs to 0xAA (10101010 in binary)
I2C Write Sequence:
START condition
- Peripheral Address: 0x02 (7-bit) + Write(0)
- Peripheral sends ACK
- Register Address: 0x00E0 (MSB first)
- Peripheral sends ACK
- Data Byte: 0xAA
- Peripheral sends ACK
STOP condition
- Results: GPIO outputs [7:0] = 1,0,1,0,1,0,1,0
Example 2: Reading DEVICE_ID from Device with
I2C Addr 0x0A
Goal: Verify communication with secondary device (ADDR3 tied to VCC) by reading DEVICE_ID
I2C Read Sequence:
START condition
- Peripheral External Address: 0x0A (7-bit) + Read(1)
- Peripheral Internal Address: 0x0000
- Peripheral sends ACK
- Master sends ACK
STOP condition
Result:
- Device #2 (0x0A) DEVICE_ID confirmed as 0x2001 Both devices confirmed present on
I2C bus
Example 3: Reading FSM_OUTPUT Status
I2C Read Sequence
Goal: Monitor current FSM output state
from device at I2C addr 0x02
START condition
- Peripheral External Address: 0x02 (7-bit) + Read(1)
- Peripheral Internal Address: 0x0051
- Peripheral sends ACK
- Peripheral transmits FSM_OUTPUT register: 0x2D
- Master sends ACK
STOP condition
Result:
- FSM State Outputs = 101101 (S5:S0 = 1,0,1,1,0,1)