2419952_en-US

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

2419952_en-US

2419952_en-US

LPI2C6 can't send 0 bit?

Hello, I am trying to implement controls on a device connected to T5 and R5 on my MIMXRT1170 SoC.

Initially, I tried to set it up like so: 

  lpi2c_master_config_t cfg;
  LPI2C_MasterGetDefaultConfig(&cfg);
  LPI2C_MasterInit(I2C_BASE, &cfg,
                   srcClockHz);
  status_t start_status = LPI2C_MasterStart(I2C_BASE, 0x15, kLPI2C_Write);
 
And I saw that it does not seem to work as expected on the scope. What I saw was the start sequence, followed by a 0, and then nothing. So I tried to replace the start command by directly writing into MTDR something like:
 
  I2C_BASE->MTDR = 0x4FA;
 
This address has a bunch of ones, followed by alternating ones and zeroes. What I see on the scope is that after the first zero, the module gives up and does not transmit the remaining bits. Why would that happen?
image17148.png
For your convenience, I'll attach the schematic:
alex0_0-1791556133098.pngalex0_1-1791556168055.png

and I'll also add that we added a couple of 2.2k pullups.

Re: LPI2C6 can't send 0 bit?

Hi @alex0 ,

Thank you so much for your interest in our products and for using our community.

regarding your question, for the LPI2C6 communication issue on pins T5 and R5, please check the below:

1: Pin configuration: Configure both SCL and SDA with SION enabled and open drain enabled . Confirm that T5/GPIO_LPSR_11 is muxed to LPI2C6_SCL and R5/GPIO_LPSR_10 to LPI2C6_SDA.  Also verify that the SCL and SDA input DAISY selections point to these pads, and check the pull-ups.

mayliu1_3-1791599821057.png

2: Debug interface: Confirm whether you are using SWD or JTAG. These pins(T5 and R5) also have JTAG functions.  if JTAG is in use, please check for a pin-mux or board-level connection conflict.

3: Clock configuration: Confirm that the LPI2C6 functional clock is enabled and that the srcClockHz value passed to LPI2C_MasterInit() matches its configured frequency. LPI2C timing depends on that functional clock.

Please retry the transfer after these checks. If it still stops during the address byte, please share the SCL/SDA waveforms and the LPI2C6 MSR value captured after the failure. 


Wish it helps you

Best Regards

May Liu

Re: LPI2C6 can't send 0 bit?

Minor correction, we are actually using JTAG, not SWD. 

With JTAG disconnected and the configuration suggested by you (fast slew rate, normal drive strength, keeper select), we now get no clock.

image31606.png

 

Re: LPI2C6 can't send 0 bit?

Hello May, thank you for your quick response!

1. Regarding the pin configuration, I noticed that it differs slightly from what we had, but SION and open drain were enabled. Regardless, we tried to modify it to match the screenshot exactly - and it still did not work. 

2. Regarding JTAG - we are aware of this. We are using SWD, but it seems that the default configuration works as is with no pin configurations. 

3. Clock works as expected. The I2C is configured to run at 100khz and it runs at exactly that.

Below is how we configure the pads:

  IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_10_LPI2C6_SDA,1U);
  IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_11_LPI2C6_SCL, 1U);
  IOMUXC_SetPinConfig(IOMUXC_GPIO_LPSR_10_LPI2C6_SDA, 0x21U);
  IOMUXC_SetPinConfig(IOMUXC_GPIO_LPSR_11_LPI2C6_SCL, 0x21U);

It is my understanding that IOMUXC_SetPinMux handles the input DAISY selections. 

#define IOMUXC_GPIO_LPSR_10_LPI2C6_SDA 0x40C08028U, 0x2U, 0x40C08090U, 0x1U, 0x40C08068U
#define IOMUXC_GPIO_LPSR_11_LPI2C6_SCL 0x40C0802CU, 0x2U, 0x40C0808CU, 0x1U, 0x40C0806CU

This seems correct:

alex0_0-1791802030066.pngalex0_1-1791802048218.png

The MSR value we get after this is: 0x02000801


Tags (1)
No ratings
Version history
Last update:
13 hours ago
Updated by: