CAN ANY POST I2C1 CODE FOR MKL25Z PLEASE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CAN ANY POST I2C1 CODE FOR MKL25Z PLEASE

807 Views
sreenathreddy
Contributor II

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

0 Kudos
5 Replies

605 Views
Kan_Li
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

605 Views
sreenathreddy
Contributor II

In the sample code ,though interrupt is not enabled, you are polling IICIF

0 Kudos

605 Views
mjbcswitzerland
Specialist V

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


0 Kudos

605 Views
mjbcswitzerland
Specialist V

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

605 Views
sreenathreddy
Contributor II

i am not using interrupts , so now i have to check whether slave ack or not

0 Kudos