Author Topic: I2C start condition issue  (Read 233 times)

Offline ABBASID

  • Newbie
  • *
  • Posts: 12
    • View Profile
I2C start condition issue
« on: June 26, 2021, 11:52:15 AM »
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"

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3158
    • View Profile
    • uTasker
Re: I2C start condition issue
« Reply #1 on: June 26, 2021, 04:14:41 PM »
Hi

I am sorry but that code is not uTasker project code and so you will need to ask at the NXP forum for help concerning it.

The uTasker I2C driver - described in https://www.utasker.com/docs/uTasker/uTasker_I2C.pdf - may make life easier than fighting with the old Freescale libraries which your framework is based on.

Regards

Mark

Offline ABBASID

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: I2C start condition issue
« Reply #2 on: July 05, 2021, 06:07:55 PM »
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