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.

c3200 master receiver send nack

Other Parts Discussed in Thread: CC3200, ENERGIA

 I am trying to communicate cc3200 with at42qt2120 over I2C.

This chip requires a Nack and a stop condition after read to release it's change line. I am able to communicate with it ( I2C read and write), but i am not able to give Nack and stop bit.

How do i give Nack from cc3200 master receiver?

I have made on own regread function on lines i2c_demo example

int read2120(char addr){ 

I2CMasterSlaveAddrSet(I2C_BASE, SLAVE_ADDRESS, false);
I2CMasterDataPut(I2C_BASE,addr );
Wire.I2CTransact(I2C_MASTER_CMD_SINGLE_SEND );
I2CMasterSlaveAddrSet(I2C_BASE, SLAVE_ADDRESS, true);
Wire.I2CTransact(I2C_MASTER_CMD_SINGLE_RECEIVE );
char recvd = I2CMasterDataGet(I2C_BASE);
return recvd;

}

I am able to read value from register with address "addr", but the slave is not receiving a Nack n stop condition as a result its change line is always low.

  • I really need response on this from TI.

    I tracked down further and found that writing 0x00000007 to I2C MCS register initiates reading of data. Bit 3 (DATACK_OR_ACK) in MCS controls Ack or not Ack ( cleared or set). I tried sending both (set /cleared) by writing 0x00000007 and 0x0000000F but i am unable to send Nack to my Slave. 

  • Hello NIrmala,

    First of all where does the function Wire.I2CTransact originate from. Is it the same function as I2CTransact in i2c_if.c?

    A good way of understanding code execution is to have debug info from LA or scope as well on the I2C Transaction.

    Regards
    Amit
  • Yes the I2CTransact is same function as in i2c_if.c, but i am using it from wire library in energia ( changed i2ctransact to public from privatein wire.h).

    I also tried calling I2C_IF_ReadFrom(ucDevAddr, &pucWrDataBuf,1, &pucRdDataBuf) directly in my code and was able to read values from registers, but i am still unable to send Nack from my Master Receiver.

    I am sure the problem is from i2c commn side and not from circuit side as i have communicated with same IC using Peter Fleury I2C lib in AVR and was able to send Nack read from host, and the change line in my client (at42qt2120) goes high after first read cycle.  

    I just need to know which bit do i need to set to send a Nack after data read by master receiver.

  • Hello Nirmala,

    I do understand it works with AVR, but then you are assuming that software is correct and not account for the subtleties of the underlying hardware. Do you have a Scope Snapshot of the same as it would be useful to see how the Read and Write transactions are being handled at the Physical Layer.?

    Regards
    Amit
  • Hi Nirmala,

    Is this issue resolved ? If so please close the thread by pressing verify answer button.

    Thanks and Regards,
    Praveen
  • Hi Praveen,

    No my problem is still not solved, i am not getting chance to test it with oscilloscope. I will post the screen shots as soon as i have access of a scope.

  • Hi Nirmala,

    Is this call, Wire.I2CTransact(I2C_MASTER_CMD_SINGLE_RECEIVE ),  you are expecting  to generate a NACK followed by STOP condition.

    I could see this function generating the expected result ( I am using I2CTransact function from i2c_if.c not  energia )

    Here is the waveform

    Thanks and Regards,

    Praveen

  • Hi Praveen,

    Thanks for the reply.

    I tried it with i2c_if.c from i2c demo example but my change line is still not getting high. I do not have scope to test the output on my arrangement, but as per your screen shots it is sending Nack in i2c_if code, so i will have to look into other aspects.

    Please suggest any other direction in which i can work on if you have any in your mind. 

  • I got it working. Changed the pull-up resistance value. Thanks Praveen.

  • Hi Nirmala,

    Thanks for confirming

    I am closing this thread now. If you have followup queries please open a new thread and add a link to this one for reference.

    Thanks and Regards,
    Praveen