Other Parts Discussed in Thread: HALCOGEN
Hello,
I'm working with I2C interrupts and I would like to clarify few things.
If I transmit a 3 bytes of data over I2C, how many TXRDY interrupts will I receive?
My understanding of the operation after going through the datasheet was,
- Copy byte 1 to I2CDXR -> I2CDXR gets transferred to I2CXSR -> #1 TXRDY interrupt
- Copy byte 2 to I2CDXR -> I2CDXR gets transferred to I2CXSR -> #2 TXRDY interrupt
- Copy byte 3 to I2CDXR -> I2CDXR gets transferred to I2CXSR -> #3 TXRDY interrupt
Ideally I should be receiving three TXRDY interrupts. This was what I was expecting.
However, the way the TI libraries handle this condition is different. It is written in such a way that it only needs (Data length - 1) number of interrupts to send all the data.
If I may go through the function call sequence of TI library,
- Data submitted through i2cSend (Data length 3)
- This will copy the first byte to the I2CDXR and enable interrupt
- Upon the h/w interrupt, i2cInterrupt function will get executed (1st byte transferred to I2CXSR)
- This will copy the second byte to the I2CDXR
- Upon the second h/w interrupt, i2cInterrupt function will get executed (2nd byte transferred to I2CXSR)
- This will copy the third byte to the I2CDXR
- Then strangely enough, the function will disable TXRDY interrupt
I commented the TXRDY interrupt disabling code, but still I could not receive the third (missing) interrupt.
Please help me understand the sequence as it is affecting our product heavily at the moment.
Thanks!