µTasker Forum

µTasker Forum => µTasker general => Topic started by: ABBASID on June 26, 2021, 11:52:15 AM

Title: I2C start condition issue
Post by: ABBASID 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"
Title: Re: I2C start condition issue
Post by: mark 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
Title: Re: I2C start condition issue
Post by: ABBASID 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