I2C start condition issue

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

I2C start condition issue

Jump to solution
1,201 Views
hfabbasi
Contributor III

I am using TWR-K60D100M-KIT and ran its accelerometer example for I2C. It ran succesffully. Modifying this example for neccessary chnages to establish I2C communication with GPIO expander PCA9698, I am facing a problem. The line of code which generates Start bit in accelerometer example is not generating satrt condition in my GPIO expander case (saw using oscilloscope). The values of I2C related registers just before the line of code generating start condition in both cases (on my pcb and TWR-K60D100M-KIT) are exactly same. So what would be the possible cause of start condition not being generated. SCL and SDA lines of I2C are pulled by 1.5k resistor value (voltage is 3.3V) in my pcb. Address of PCA9698 is 0x40 and I am trying to turn led on/off attached to bank 0, pin 0. Code is attached. Start-condition-code at line 686 of "fsl_i2c.c"

0 Kudos
Reply
1 Solution
1,146 Views
hfabbasi
Contributor III

Thanks for your suggestion. After so many hours of hard labour, I finally came to the realization that I was not initiating the pin configuration properly to use I2C functionality of PORTE (pin 0 and 1). I2C_1 is ALT6 of PORTE (pin 0 and 1) which I was overlooking in pin_mux.c file

View solution in original post

0 Kudos
Reply
3 Replies
1,182 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello

Hope you are well. I will gladly help you with this.
Could you attach your oscilloscope captures? It could give us a good insight into what is happening.
Additionally, I suggest you check the pin configuration, specifically the functionality you are configuring the I2C. You can change this in the pin_mux.c file

Let me know if this is helpful, if you have more questions do not hesitate to ask me.
Best regards,
Omar

0 Kudos
Reply
1,147 Views
hfabbasi
Contributor III

Thanks for your suggestion. After so many hours of hard labour, I finally came to the realization that I was not initiating the pin configuration properly to use I2C functionality of PORTE (pin 0 and 1). I2C_1 is ALT6 of PORTE (pin 0 and 1) which I was overlooking in pin_mux.c file

0 Kudos
Reply
1,162 Views
hfabbasi
Contributor III

What are the possible causes of start bit not being generated in I2C using MK60DX256VLL10 though the same code is running fine when using TWR-K60D100M. In my own PCB, MK60DX256VLL10 drives PCA9698 using I2C but could not get it to work becaue microcontroller is not able to generate start bit. When I use I2C signals of TWR-K60D100M (in which accelerometer is being controlled using I2C) to connect to PCA9698, PCA9698 starts working because now the start bit is being generated. Is there any I2C specific setting to initiate in my controller MK60DX256VLL10 ( some settings to initiate I2C or something like that which is not mentioned in manuals) beacuse I am sucessfully using this controller on my same PCB to make use of its GPIO and CAN ports?

0 Kudos
Reply