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.

TMS570LS1227: I2CCNT Register Doesn't Work

Part Number: TMS570LS1227
Other Parts Discussed in Thread: HALCOGEN

Hi,

I am trying to communicate with i2c while my module is at slave receiver mode. 

I am sending commands to HDK from computer but my I2CCNT register doesn't change. 

I can see the values i send received in rx buffer and etc but CNT register doenst increase or decrease at all. 

What part i am missing?

  • Hi Gunce,

    I2CCNT register is a down count register, and which is used to configure number of bytes to be transmitted, and after transmitting each byte this down counter will get decremented by one and after transmitting the required number of bytes i.e., the counter gets zero then the stop condition automatically gets transmitted. 

    If you observe below example code

    here we are setting this I2CCNT register with number of bytes we want to transmit i.e. 10 bytes in this case before triggering start condition, once after triggering start condition the data will get transmit byte by byte and this CNT register will get decrement by one each time until it becomes zero and once it's become zero the stop condition will get triggered.

    --

    Thanks & Regards,
    Jagadish.

  • Hi Jagadish,

    I set my data count value from HALCOGEN and since also in examples' comment is says its optional, i didnt use i2cSetCount command on my code. 

    I'm setting the I2CCNT register to 3 for my project. This is my buffer and registers before receive any data.  It is set correctly as 3. 

    This is after receive 3 bytes data. I can see the values i send are received in my rxBuffer. Shouldn't the I2CCNT register be 0 now? Its still same and doesn't decrease.

    Shouldn't this register be automatically counted? Or should I do something specifically to run it properly?

  • Hi Gunce,

    I will check at my end and update you.

    --

    Thanks & Regards,

    Jagadish.

  • Hi Gunce,

    Just now i tested and you are right the register is not decrementing but it is working as i mentioned.

    I just tested 3 conditions, with 3 bytes of data 

    1. The first condition is the positive one i.e., as i am sending 3 bytes right so i initialized the CNT register with value of 3 and here is the output

    Here the stop condition is generated after 3 bytes, and which is obvious behavior.

    2. Now i initialized CNT register with value of 1 even though i tried to transmit 3 bytes(i.e. 3 bytes are given to i2cSend function)

    Here you can see right after sending 1 byte the stop condition was immediately transmitted.

    3. Now i initialized CNT register with value of 5 even though i tried to transmit 3 bytes(i.e. 3 bytes are given to i2cSend function)

    Here you can see right the STOP condition not at all generated because the CNT value is initialized to 5 but we are giving only 3 bytes as input.

    And i noted that CNT register behavior and not sure why it is not properly updating, i will discuss with internal team on this.

    --

    Thanks & Regards,
    Jagadish.