FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
5958 Discussions

I2C Problem - Cyclone 10 GX dev kit

gbessa
Novice
920 Views
I'm using Cyclone 10 GX Development Kit and I'm trying to access (read/write) to the I2C I/O expander that interfaces with the SFP peripheral signals.
This is very important to me because I need to change the value of TX_DIS to be able to send data over the SFP.
 
The slave device seems to not respond because it does not pull the line low during the ACKnowledge bit.
I2C slave device: TI TCA9534PWR
I2c slave address 010 0000
First I used the "Avalon I2C (master) Intel FPGA IP" but then moved to a I2C_Master module made by me. I have been using Signal Tap Logic Analyzer to check the behavior. So now I'll explain how the module works (written in verilog).
 
SDA and SCL signals
Since I2C signals are connected externally to pull-up resistors I have two signals (sda and scl) with the value I want the I2C bus to have. And then I have two wires with the inverted/reverse value (sda_rev and scl_rev). These signals are the output enables of tri-state buffers:
Actually scl is not bi-directional, but I apply the same concept: the line is always in high impedance (pulled up externally) or pulled low by the i2c_master.
 
image.png
 
Frequency of SCL
The slave device can work with 100 kHz or 400kHz. I use 100kHz just because it allows for integer division with 125MHz (8ns).
100kHz has 10000ns clock cycle:  5000ns up/down: (8ns*625)
I simply change the polarity of the new clock every 625 clock cycles.
image (1).png
 
Here is the waveform. This is just a simple read read request:
Start - Address (010000) - Read - ACK (should be 0)image (2).png
 

What could the problem be?

I think I checked everything and don't know what more can I try 

 
Other infos:
 
0 Kudos
1 Solution
gbessa
Novice
784 Views

Hi,

The problem is solved.

 

The I2C slave device does not allow a read like I was doing. First there should be a write before the read. It has a specific pattern for each operation, concerning if it's a read or write and concerning the register that is accessed.
These details are explained in the datasheet of the I2C external device (TI TCA9534PWR): https://www.ti.com/lit/gpn/tca9534

View solution in original post

0 Kudos
4 Replies
lixy
Employee
877 Views

Hi gbssa,


I wonder if you are able to test the waveform with Oscilloscope.

The SignalTap waveform shows the internal signal. It would be helpful if we can know the exact signal on board both at the FPGA and the I2C slave side. There could be a situation that the signal is not correctly received by the slave, such as board-level transfer issue, I/O Pin issue, and so on.


Thanks & Regards,

Xiaoyan


0 Kudos
lixy
Employee
809 Views

Hi gbessa,


Any updates?


Thanks & Regards,

XY


0 Kudos
gbessa
Novice
785 Views

Hi,

The problem is solved.

 

The I2C slave device does not allow a read like I was doing. First there should be a write before the read. It has a specific pattern for each operation, concerning if it's a read or write and concerning the register that is accessed.
These details are explained in the datasheet of the I2C external device (TI TCA9534PWR): https://www.ti.com/lit/gpn/tca9534

0 Kudos
lixy
Employee
761 Views

Hi there,


Happy to hear that the problem is resolved and thanks for sharing the root cause of the problem.


Thanks & Regards,

Xiaoyan


0 Kudos
Reply