hi,
i am trying code for i2c since 5 days for mkl25z ,
doubt 1: after transmitting slave address , i need to check whether ack is receiving or not.so which flag i have to poll.
doubt 2: after stop enable my rxak bit is clearing,says that ack is received why ?
Original Attachment has been moved to: main.c.zip
Hi Sreenath Reddy,
We provide I2C sample code for master and slave mode based on FRDM-KL05Z, please kindly refer to FRDM-KL05Z Sample Code Package for details.
Hope that helps,
Have a great day,
Kan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
In the sample code ,though interrupt is not enabled, you are polling IICIF
Hi
Whether using interrupts or not the interrupt flag still needs to be used to know when a byte transfer has completed and the slave acknowledge bit is ready to be read.
Regards
Mark
Kinetis: µTasker Kinetis support
KL25: µTasker Kinetis FRDM-KL25Z support / µTasker Kinetis TWR-KL25Z48M support
For the complete "out-of-the-box" Kinetis experience and faster time to market
Hi
>>doubt 1: after transmitting slave address , i need to check whether ack is receiving or not.so which flag i have to poll.
I2C Status register (I2Cx_S)
However you don't poll it - you poll IICIF and then check whether the slave acknowledged or not.
>>doubt 2: after stop enable my rxak bit is clearing,says that ack is received why ?
When sending a stop condition there is no more slave activity and the state of the RXACK flag is not of importance.
Regards
Mark
Kinetis: µTasker Kinetis support
KL25: µTasker Kinetis FRDM-KL25Z support / µTasker Kinetis TWR-KL25Z48M support
For the complete "out-of-the-box" Kinetis experience and faster time to market
i am not using interrupts , so now i have to check whether slave ack or not