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.

AM625SIP: MCT8316 requires 100us i2c delay between bytes

Part Number: AM625SIP
Other Parts Discussed in Thread: MCT8316A,

Tool/software:

All, 

The assigned focus customer is trying to communicate to an MCT8316A motor driver through I2c on the M4 of an AM625SIP.

He is unable to transmit or receive over i2c.

Upon inspection it was found that the MCT8316A requires a 100uS delay to be inserted between bytes or the part locks up and must have a hard reset.  This is an errata for the part.

The customer could also use Linux to talk to the MCT8316A directly over i2c and bypass the M4 if that can be made to work.

He also confirmed it is on the read back between bytes between the Master AM62 and the Slave MCT on the transfer from MCT to AM62.  He needs a 4 byte transfer and the 100us between bytes has to be accommodated in HW on the AM62 side.  He can’t do 4 single byte transfers. 

Any ideas on the M4 or on Linux that might work?

Best Regards, 

Blake

  • Hello Blake,

    Off the top of my head, from the Linux side, this would be difficult to implement. For now I am sending the thread over to Anil.

    For future readers, here is Anil's initial response:

    Hello Blake,

    I think we can apply the method below to achieve your requirements.
    Method : Timer + Application State Machine + I2C.

    let's say users need to send 4 bytes.
    For that, we need to send the command below.
    Command : SA+W → ACK → DB1→ACK → DB2 → ACK →DB3 → ACK → DB4 → ACK → Stop

    So, we will divide the above command into 3 states.

    State 0 → Send Device Address and write

    State 1 → Send 4 Bytes + Stop

    State 3 → idle.

    Next, I have enabled timer interrupt for every 100use.

    In the Timer ISR routine, I will implement the above 3 states.

    Step 1 : By default state is idle , whenever you want to send/read data bytes , just change state from idle to State 1.
    For the first 100usec, I will send the SA+W and move to the next state.

    For the next 100use, check ack and send DB1

    For the next 100usec, check ack and send DB2 and so on till DB4

    Once done sending all bytes, then send stops goes to an idle state.

    When you ever you want to start the I2C communication, then switch to state 1 and repeat the same procedure above .

    But, we can’t go with an MCU+SDK driver for this case, since MCU+SDK driver implementation is different.
    We can try the same method on either M4F or A53 core with the polling Mode .

    Regards,
    Anil.

    Regards,

    Nick

  • Hi Nick, 

    Great thoughts!  I am bouncing it off the engineer to see what he thinks.  I get my EVM next week and may boot it and give it a try.

    Thanks!

    Blake

  • Hello Blake,

    We need to verify the above method on EVM and share your test results once you have done testing.

    Regards,

    Anil.

  • Hi Anil and Nick, 

    The customer notes:

    Thanks for the info. That is essentially what I have already done to get TX to work and it does work fine. The issue is with reading the bus. Do they have a suggestion for that? I could not find a way for the peripheral to read one byte at a time without restarting the transmission each time.

    Any thoughts?

    Best Regards, 

    Blake

  • Do they have a suggestion for that? I could not find a way for the peripheral to read one byte at a time without restarting the transmission each time.

    Hey Blake,

    To read also, do we need to wait for 100usec to read each byte ?

    If this is the case, after sending SA+R, then we should not clear the interrupt flag. So, that the master's device will pull the clock till low.

    After 100usec just clears the interrupt flag hopefully at this time Salve needs to send data bytes and master will generate clock.

    I have not tried this one, you can just try and see how the I2C clock is behaving if we don't clear an interrupt.

    I could not find a way for the peripheral to read one byte at a time without restarting the transmission each time.

    So, to read one byte -> sending SA+R, next stop. After 100 usec ,again  are you sending  SA+R to read one byte ?

    Can you please explain what are you doing here ?

    Regards,

    Anil.