I2C start condition issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

I2C start condition issue

跳至解决方案
1,300 次查看
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 项奖励
回复
1 解答
1,245 次查看
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 项奖励
回复
3 回复数
1,281 次查看
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 项奖励
回复
1,246 次查看
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 项奖励
回复
1,261 次查看
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 项奖励
回复