Other Parts Discussed in Thread: C2000WARE
Hello TI team,
I am working on I2C driver, I have managed to get i2c fifo working and fifo Tx, fifo Rx interrupts working. I am getting interrupts properly.
My problem is that when I try to read EEPROM I am going to some random address value and not getting to proper memory location what I want
Currently for reading I am following below steps in my Read operation (* Module is disabled in step 1)
- I am setting slave addr(0x50) and then I am making TRX to 1 for Transmitting address value and MST = 1 and load register address in my global array in my Transmit function
- Then I am enabling module (IRS = 1), I am loading data before Enabling module as my TXFIFO level is set to 0.
- Now Tx interrupt HITS and data(memory addr which I want to access) is loaded into I2CDXR register(fifo buffer)
- Then push 1 start condition by setting STT
- I am setting TRX bit to 0 for read, MST = 1 and then I am setting Slave address(0x50) in register
- I am getting Rx interrupt but data in I2CDRR register is not which I wrote there using MY WRITE FUNCTION.
My write function is working as I can see values which I loaded, I can only see this values when I do multiple time read (So I know data is written in EEPROM) (it is new EEPROM so all data bits must be 1)
I suspect that write might also not accessing correct address which I am passing or wish to write.
SO PLEASE TELL ME HOW DO I ACCESS CORRECT LOCATION, WHAT AM I MISSING ?
What I want to do is write and read from specific locations.
My code is pretty generic as it should work with sensors, eeprom and other i2c supporting devices.
