MIMXRT1051 LPI2C2 Always Bus Busy

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

MIMXRT1051 LPI2C2 Always Bus Busy

2,218 Views
nhilderm
Contributor II

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

We have Pull-ups on SDA.

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

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 */

Any suggestions?

Nathan

3 Replies

2,053 Views
maciej
Contributor I

I am having the same problem with MIMXRT1062 (Teensy 4.0 board). I think I got a step further: IOMUXC daisy chain settings make LPI2C1 read from different pins than broken out to my board. After selecting correct pins in IOMUXC_LPI2C1_SCL_SELECT_INPUT and IOMUXC_LPI2C1_SDA_SELECT_INPUT, I now get a single start impulse (on both clock SCL and SDA), low state persists until after end of clock pulse, but it's detected correctly and sets the Arbitration Lost Flag (which is a more widely reported situation).

Timing from logic state analyser attached for the record, stil trying to figure out how to make it work (tried different pad configurations, tried adding an external pull-up resistor, no success so far).

2019-11-03-203648_458x292_scrot.png

Update: as I read through SDK code (I can't use it directly because my project is in Rust), I found the missing difference. Not only pad control need to be configured, but also SION (software input on) in the mux config. I2C works now! For the record, here are IOMUXC mux/pad settings from the SDK, non-defaults highlighted:

  - {pin_num: J11, peripheral: LPI2C1, signal: SCL, pin_signal: GPIO_AD_B1_00, software_input_on: Enable, hysteresis_enable: Disable, pull_up_down_config: Pull_Up_22K_Ohm, pull_keeper_select: Keeper, pull_keeper_enable: Enable, open_drain: Enable, speed: MHZ_100, drive_strength: R0_6, slew_rate: Slow}
  - {pin_num: K11, peripheral: LPI2C1, signal: SDA, pin_signal: GPIO_AD_B1_01, software_input_on: Enable, hysteresis_enable: Disable, pull_up_down_config: Pull_Up_22K_Ohm, pull_keeper_select: Keeper, pull_keeper_enable: Enable, open_drain: Enable, speed: MHZ_100, drive_strength: R0_6, slew_rate: Slow}

1,891 Views
avbot
Contributor III

Thanks! This solved the issue for me... seems the Software Input setting is not enabled by the I2C driver.

0 Kudos
Reply

2,053 Views
Keith4DSmith
Contributor V

I had the same problem. Until I matched the GPIO settings as shown in an SDK I2C example, I2C would not work properly.

The default GPIO mux settings for I2C in the Config Tool produce an unusable configuration. [Version 5 of the ConfigTool]

My suspicion is the key setting is Software Input On:Enable. (Open Drain:Enable doesn't hurt.)

I have tried to understand what function Software Input On:Enable provides. In the Reference Manual, the only use of the phrase 'Software Input On' is in the pin configuration tables, Enabled or Disabled, 10.5.x. and cryptic statement in 10.3.2.

0 Kudos
Reply