This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28386D: I2C communication problem "i2c_ex2_eeprom" TI example

Part Number: TMS320F28386D
Other Parts Discussed in Thread: TMS320F28377D, SYSCONFIG

Hello,

I have a problem of communication with I2C by running the following example: "i2c_ex2_eeprom".

I'm trying to establish the I2C communication between TMS320F28386D and the EEPROM 24LC512-E/SM.

I'm using this example but I needed to edit some details to use it with my custom board:

- I need to use I2C_B and not I2C_A like the example, for that I'm using this following GPIO pins:

- I changed all the macro and functions of I2C_A with the macro of I2C_B (e.g INT_I2CB, i2cBISR, I2CB_BASE) inside the code.

- I setted the external I2C EEPROM at address 0x51 (and not 0x50 like the example)
- I connected DEVICE_GPIO_PIN_SDAB on to external EEPROM SDA (serial data) pin.
- I connected DEVICE_GPIO_PIN_SCLB on to external EEPROM SCL (serial clock) pin.

When I run the program, the code is fixed on the fail loop at the end of code (in debug I see the failCount=8 and the array msgbuffer of i2cMsgIn with 255 decimal values):

By checking with oscilloscope, I don't see any clock in SCL pin of the EEPROM, this seems strange.

I don't know where is the problem, is it due to a wrong implementation of changes on the code? Wrong interpretation on the functioning of i2c or of example?

  • Hello Gianni,

    If you run the normal example, can you confirm that the oscilloscope shows the proper clocking/data? If so then yes, this means something in your changes was not done properly.

  • I can not able to run the normal example because I use a custom board with constrains of connection (assigned pin that I can not change).

  • Hi,

    Have you already reviewed the Interface EEPROM Using I2C? Are the lines for SCL and SDA stuck high or low since they're not changing?

  • Hello,

    I used this type of EEPROM for others I2C applications with others custom board and it worked correctly (I'm using the same rule to connect the pins between EEPROM and DSP).

    I see SDA and SCL pins always low at the moment.

    In attached my edited project.

    i2c_ex2_eeprom.rar

  • I used this type of EEPROM for others I2C applications with others custom board and it worked correctly (I'm using the same rule to connect the pins between EEPROM and DSP).

    I see SDA and SCL pins always low at the moment.

    In the previous I2C applications you had, was it with this same TI device? If the SDA and SCL pins are always low, it sounds like their may not be sufficient pull-up strength. By default, the lines should be high as in with any I2C protocol (the falling edges of SDA/SCL indicate the start of a data frame). Is this issue happening on more than one board or have you only tested this with the current hardware you're using?

  • In the previous I2C applications you had, was it with this same TI device?

    It was used TMS320F28377D and the same EEPROM.

    Is this issue happening on more than one board or have you only tested this with the current hardware you're using?

    I have tested only this board at the moment.

  • If the SDA and SCL pins are always low, it sounds like their may not be sufficient pull-up strength.

    Sorry, my mistake, I see always 3.3V in SDA and SCL pins.

  • Sorry, my mistake, I see always 3.3V in SDA and SCL pins.

    Oh, so the pin never goes low? If you try to use it as a GPIO and set it to output low is there any issue?

    It was used TMS320F28377D and the same EEPROM.

    Were there any hardware or software changes beyond changing the C2000 device?

  • If you try to use it as a GPIO and set it to output low is there any issue?

    I setted SDA low and it stay low and after I setted SCL low and it stay low correctly.

    Were there any hardware or software changes beyond changing the C2000 device?

    The hardware for these pins is the same (with the pull-up resistors) like the other board.

  • Hello Gianni,

    Since this doesn't seem to be a hardware issue, I will try to emulate this setup.

  • Hello Gianni,

    I used the example on my side and found that using GPIO40 and GPIO41 for I2C B seemingly worked fine, but using GPIO2 and GPIO3 had an issue where the clock went but didn't clock and the data line remained high. This issue doesn't seem to be isolated to your device, at least from my testing. There is no note or known issue about this, so I will ask design team to see if they might know why this is the case.

  • Hello Omer,

    Thank you for the feedback, so I will wait some news about that.

  • I should be able to get a response by the end of the week, but I'll let you know if anything changes.

  • Hello Gianni,

    Have you verified that i2c_ex1_loopback and i2c_ex3_external_loopback work fine for you? The design team was not able to replicate the same issue (the issue I saw might be related to something else, I did not have a proper setup), so I'm wondering if you test those two examples if you can see the sData, rData, and rDataPoint values changing in the CCS Expressions window. I verified this on the F28388D ControlCARD and saw that the communication seemed to be happening.

    If these examples work, trying using that as a basis for communicating with your EEPROM.

  • Hello Omer,

    I tried "i2c_ex1_loopback" example (editing through SysConfig the pins for I2CB) and it does work correctly.

    This means that something goes wrong changing the code from I2CA to I2CB on "i2c_ex2_eeprom" example? Or an hardware issue? Because "i2c_ex1_loopback" does not exclude these two hypothesis (with i2c_ex1_loopback we are just testing the I2C module).

  • This means that something goes wrong changing the code from I2CA to I2CB on "i2c_ex2_eeprom" example? Or an hardware issue?

    Please try to also do i2c_ex3_external_loopback as I recommended, modifying the configuration code to use GPIO2/3 for I2C B. Verify whether this works or fails, like you stated example 1 is just an internal check to make sure the I2C itself is not a problem. Example 2 uses the actual pins, which I tested on a ControlCARD without issue. If this works, then that means the example itself needs to be addressed.

  • Please try to also do i2c_ex3_external_loopback as I recommended, modifying the configuration code to use GPIO2/3 for I2C B. Verify whether this works or fails, like you stated example 1 is just an internal check to make sure the I2C itself is not a problem. Example 2 uses the actual pins, which I tested on a ControlCARD without issue. If this works, then that means the example itself needs to be addressed.

    By trying the "i2c_ex3_external_loopback" example and I don't see the sData, rData, and rDataPoint values changing in the CCS Expressions window.

    This is the setup that I've used:

    //I2CA GPIO pins
    #define DEVICE_GPIO_PIN_SDAA 0
    #define DEVICE_GPIO_PIN_SCLA 1
    
    //I2CB GPIO pins
    #define DEVICE_GPIO_PIN_SDAB 2
    #define DEVICE_GPIO_PIN_SCLB 3
    
    #define DEVICE_GPIO_CFG_SDAA GPIO_0_I2CA_SDA
    #define DEVICE_GPIO_CFG_SCLA GPIO_1_I2CA_SCL
    
    #define DEVICE_GPIO_CFG_SDAB GPIO_2_I2CB_SDA
    #define DEVICE_GPIO_CFG_SCLB GPIO_3_I2CB_SCL

  • By trying the "i2c_ex3_external_loopback" example and I don't see the sData, rData, and rDataPoint values changing in the CCS Expressions window.

    Did you externally connect the I2C A and I2C B SDA/SCL pins respectively? If so and you still didn't see any values changing, this is a sign that the problem may be caused by something in your hardware, I suggest double-checking on another board/available device if possible. I tested on a ControlCARD without issue, so it should connect successfully.

  • Did you externally connect the I2C A and I2C B SDA/SCL pins respectively? If so and you still didn't see any values changing, this is a sign that the problem may be caused by something in your hardware, I suggest double-checking on another board/available device if possible. I tested on a ControlCARD without issue, so it should connect successfully.

    I thought it was not necessary to make the physical connection of pins for this example.

    Unfortunately it is not possible to connect the pins for this custom board, so I can not try this example.

  • I thought it was not necessary to make the physical connection of pins for this example.

    The example is specifically called external loopback, the description of the example at the top of the main source file also describes this.

    Unfortunately it is not possible to connect the pins for this custom board, so I can not try this example.

    Since I'm able to verify this on the ControlCARD, it's not clear to me whether this is an issue with your hardware or a problem with the software example. If there is absolutely no way for you to try to connect the pins together, I will try to continue working with the design team to see if they can replicate this issue or not, although I expect there may be at least a week delay or longer.

  • Hello Gianni,

    The design expert was actually able to test this out today, they ran the software example 3 (not connected to EEPROM) and managed to see the I2C B on GPIO2/3 behaving as expected. They used a 1K pull up on the SDA and SCL, although they didn't have an EEPROM on hand so they just scoped the pins. Based on this, I believe that my setup was incorrect (I was relying on an older PCB that required a lot of setup with switches, which I may not have configured correctly), and you may need to check either your hardware or board design to verify the connections.

    Unless you can test the I2C B GPIO 2/3 similar to something like the external loopback example, there is not much more guidance I can offer than this. You need to be able to validate the example works on a standalone device connected to EEPROM, such as on a breadboard or something similarly configurable. The design expert isn't able to see the same issue that you are, and there is no known reason that this should fail.

  • Hello Omer,

    I will search a way to do this test and I will give you a feedback. Thank you.