I2C1(GPIO_B0_04 & _05) not working on MXRT1052

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

I2C1(GPIO_B0_04 & _05) not working on MXRT1052

850 Views
jamesk
Contributor III

I only have this problem on LPI2C2. When using LPI2C1 it works fine.

The Clock seems good, but SDA transitions from high to low when clock starts and stays low.

We have Pull-ups on SDA.

 

 

I am using the simplest i2c polling example MCUExpresso Project but change:

1. LPI2C2 base address instead of LPI2C1

2. Changed the LPI2C2 instead of LPI2C1 in the PinMux settings as below

IOMUXC_SetPinMux(
IOMUXC_GPIO_B0_04_LPI2C2_SCL, /* GPIO_AD_B1_00 is configured as LPI2C1_SCL */
1U); /* Software Input On Field: Force input path of pad GPIO_AD_B1_00 */
IOMUXC_SetPinMux(
IOMUXC_GPIO_B0_05_LPI2C2_SDA, /* GPIO_AD_B1_01 is configured as LPI2C1_SDA */
1U); /* Software Input On Field: Force input path of pad GPIO_AD_B1_01 */
IOMUXC_SetPinConfig(
IOMUXC_GPIO_B0_04_LPI2C2_SCL, /* GPIO_AD_B1_00 PAD functional properties : */
0xD8B0u); /* Slew Rate Field: Slow Slew Rate
Drive Strength Field: R0/6
Speed Field: medium(100MHz)
Open Drain Enable Field: Open Drain Enabled
Pull / Keep Enable Field: Pull/Keeper Enabled
Pull / Keep Select Field: Keeper
Pull Up / Down Config. Field: 22K Ohm Pull Up
Hyst. Enable Field: Hysteresis Disabled */
IOMUXC_SetPinConfig(
IOMUXC_GPIO_B0_05_LPI2C2_SDA, /* GPIO_AD_B1_01 PAD functional properties : */
0xD8B0u); /* Slew Rate Field: Slow Slew Rate
Drive Strength Field: R0/6
Speed Field: medium(100MHz)
Open Drain Enable Field: Open Drain Enabled
Pull / Keep Enable Field: Pull/Keeper Enabled
Pull / Keep Select Field: Keeper
Pull Up / Down Config. Field: 22K Ohm Pull Up
Hyst. Enable Field: Hysteresis Disabled */

 

I see few posting reporting the same issue. 

Is this a known problem by NXP? If so, what is a resolution?

Regards,

3 Replies

731 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hi James, 

As we reviewed on the ticket, it seems that the behavior you are facing is due to the configurations of the pins. Please try the configuration shown below. 

void BOARD_InitPins(void) {
  CLOCK_EnableClock(kCLOCK_Iomuxc);           /* iomuxc clock (iomuxc_clk_enable): 0x03U */

  IOMUXC_SetPinMux(
      IOMUXC_GPIO_B0_04_LPI2C2_SCL,           /* GPIO_B0_04 is configured as LPI2C2_SCL */
      1U);                                    /* Software Input On Field: Force input path of pad GPIO_B0_04 */
  IOMUXC_SetPinMux(
      IOMUXC_GPIO_B0_05_LPI2C2_SDA,           /* GPIO_B0_05 is configured as LPI2C2_SDA */
      1U);                                    /* Software Input On Field: Force input path of pad GPIO_B0_05 */
  IOMUXC_SetPinConfig(
      IOMUXC_GPIO_B0_04_LPI2C2_SCL,           /* GPIO_B0_04 PAD functional properties : */
      0xD8B0U);                               /* Slew Rate Field: Slow Slew Rate
                                                 Drive Strength Field: R0/6
                                                 Speed Field: medium(100MHz)
                                                 Open Drain Enable Field: Open Drain Enabled
                                                 Pull / Keep Enable Field: Pull/Keeper Enabled
                                                 Pull / Keep Select Field: Keeper
                                                 Pull Up / Down Config. Field: 22K Ohm Pull Up
                                                 Hyst. Enable Field: Hysteresis Disabled */
  IOMUXC_SetPinConfig(
      IOMUXC_GPIO_B0_05_LPI2C2_SDA,           /* GPIO_B0_05 PAD functional properties : */
      0xD8B0U);                               /* Slew Rate Field: Slow Slew Rate
                                                 Drive Strength Field: R0/6
                                                 Speed Field: medium(100MHz)
                                                 Open Drain Enable Field: Open Drain Enabled
                                                 Pull / Keep Enable Field: Pull/Keeper Enabled
                                                 Pull / Keep Select Field: Keeper
                                                 Pull Up / Down Config. Field: 22K Ohm Pull Up
                                                 Hyst. Enable Field: Hysteresis Disabled */
}

Regards, 

Victor 

731 Views
jamesk
Contributor III

Thanks Victor for your answer.

The code you proposed above is exactly how I initialize and configure the pins for LPI2C2 and it still does not work.

Have you tried it yourself?

If you look for NXP examples, interestingly the examples don't use LPI2C2. You only see examples using LPI2C1 and LPI2C3.

I suspect there is a reason why?

0 Kudos

731 Views
nxp16
Contributor III

I'm having a similar issue with the IMXRT1062.  No matter what I do LPI2C2 does not work.  I see no clock or data in my analyzer on the lines.  I even tried Victor's pin configs above.  In the ref man, at least for the 1062, it says in order to use GPIO_B0_04/05 for LPI2C2 (instead of GPIO_SD_B1_10/11) you have to set the daisy/select input for those pins in the iomuxc:

IOMUXC->SELECT_INPUT[kIOMUXC_LPI2C2_SDA_SELECT_INPUT] = 1; // see refman

IOMUXC->SELECT_INPUT[kIOMUXC_LPI2C2_SCL_SELECT_INPUT] = 1; // see refman

However, for me this still doesn't work.  Double check the 1052 ref man and try this out and see if it works.

I've had no issues with LPI2C1 or LPI2C3, just LPI2C2.

-m

0 Kudos