Hi,
I am trying to access the user LEDs on omap L138 experimenter kit which are connected through the I2C expander (TCA6416PW) through I2C0.
While trying to select the port 1 configuration register (for reversing the polarity of port 1 to output), NACK bit is getting set in the ICSTR register.
Following is the configuration of the registers after configuring I2C0 and before starting the write operation.
ICOAR: 0x00000000
ICIMR: 0x00000000
ICSTR: 0x00000410
ICCLKL: 0x0000002D
ICCLKH: 0x0000002D
ICCNT: 0x00000000
ICDRR: 0x00000000
ICSAR: 0x00000020
ICDXR: 0x00000000
ICMDR: 0x00004420
ICIVR: 0x00000000
ICEMDR: 0x00000001
ICPSC: 0x00000002
ICREVID1: 0x00004415
ICREVID2: 0x00002206
ICPFUNC: 0x00000000
ICPDIR: 0x00000000
ICPDIN: 0x00000003
ICPDOUT: 0x00000000
ICPDSET: 0x00000000
ICPDCLR: 0x00000000
I2C0 is powered by the aux-clock, sourced by a 24Mhz crystal.
Therefore, the PSC value is kept as 2 to keep the prescalar frequency in range (8Mhz)
During the write operation, the following registers are set in order:
> Waited for busy bit to get cleared
> Set master mode bit in ICMDR
> Set TRX mode = transmit
> Set ICCNT to 2 (select config register + port value write)
> Load ICDXR with the config register address: 0x6h
> Set STT in the ICMDR (Start the transaction)
> Wait for Transmit-ready in ICSTR to load the second word => At this point, NACK is observed in the ICSTR
The PINMUX4 shows the value 0x11222288 (SDA/SCLK pins configured to I2C function)
The value in ICSTR is: 0x00001406 after the above steps
Can anyone let me know if any additional configuration is required to make it work?