LPC55x I2C Flexcomm2 PIO1_27

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

LPC55x I2C Flexcomm2 PIO1_27

Jump to solution
832 Views
lsl
Contributor I

Hi,

I2C on Flexcomm2 using PIO1_24 as SDA and PIO1_27 as SCL results in a non-functional setup, while I2C on Flexcomm2 using PIO1_24 as SDA and PIO1_25 as SCL results in a functional setup.

Why does it not function with PIO1_27, while the MCU config tool indicates legitimate setup?

Thanks!

0 Kudos
Reply
1 Solution
788 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I think the pin configuration is correct.

On the LPC5528-EVK board, the PIO1_27 is connected to the codec, I do not know if it takes effect on the feature of PIO1_27, pls remove the R24 and have a try.

 

xiangjun_rong_0-1683254615794.png

Hope it can help you

BR

XiangJun Rong

 

View solution in original post

0 Kudos
Reply
6 Replies
816 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

First of all,l I suppose that you use LPC551x/LPC55S1x processor, regarding your question that you can not function the PIO1_27 as FC2_SCL, I suppose that you do not configure the pin PIO1_27 correctly.

Pls try to use the code in pin_mux.c in SDK example like:

/* Enables the clock for the IOCON block. 0 = Disable; 1 = Enable.: 0x01u */
CLOCK_EnableClock(kCLOCK_Iocon);

//PIO1_27 FC2_RTS_SCL_SSEL1

#define IOCON_PIO_FUNC1 1

#define IOCON_PIO_OPENDRAIN_EI 0x200

const uint32_t PIO1_27 = (/* Pin is configured as PIO1_27 */
IOCON_PIO_FUNC1 |
/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_EI);

IOCON_PinMuxSet(IOCON, 1, 27, PIO1_27 );

 

Pls have a try.

If you still have problem, pls check the IOCON->PIO[1][27] register in debugger.

I suppose that you have to connect a 10K ohm pull-up register for the PIO1_27 pin.

Hope it can help you

BR

XiangJun Rong

 

0 Kudos
Reply
811 Views
lsl
Contributor I

Hi xiangjun, thank you for the reply. For reference the code is being run on lpc55s28-evk. The pin config code was generated using MCUXpresso config tool v12.1

I have attempted to use the suggested code to no improvement.

Here is the original non-working config and the modified working config

not working
============================

 

/*!
 * @brief Select Digital mode.: Enable Digital mode. Digital input is enabled. */
#define PIO1_24_DIGIMODE_DIGITAL 0x01u
/*!
 * @brief Selects pin function.: Alternative connection 1. */
#define PIO1_24_FUNC_ALT1 0x01u
/*!
 * @brief Select Digital mode.: Enable Digital mode. Digital input is enabled. */
#define PIO1_27_DIGIMODE_DIGITAL 0x01u
/*!
 * @brief Selects pin function.: Alternative connection 1. */
#define PIO1_27_FUNC_ALT1 0x01u


    IOCON->PIO[1][24] = ((IOCON->PIO[1][24] &
                          /* Mask bits to zero which are setting */
                          (~(IOCON_PIO_FUNC_MASK | IOCON_PIO_DIGIMODE_MASK)))

                         /* Selects pin function.
                          * : PORT124 (pin F6) is configured as FC2_RXD_SDA_MOSI_DATA. */
                         | IOCON_PIO_FUNC(PIO1_24_FUNC_ALT1)

                         /* Select Digital mode.
                          * : Enable Digital mode.
                          * Digital input is enabled. */
                         | IOCON_PIO_DIGIMODE(PIO1_24_DIGIMODE_DIGITAL));


    IOCON->PIO[1][27] = ((IOCON->PIO[1][27] &
                          /* Mask bits to zero which are setting */
                          (~(IOCON_PIO_FUNC_MASK | IOCON_PIO_DIGIMODE_MASK)))

                         /* Selects pin function.
                          * : PORT127 (pin E8) is configured as FC2_RTS_SCL_SSEL1. */
                         | IOCON_PIO_FUNC(PIO1_27_FUNC_ALT1)

                         /* Select Digital mode.
                          * : Enable Digital mode.
                          * Digital input is enabled. */
                         | IOCON_PIO_DIGIMODE(PIO1_27_DIGIMODE_DIGITAL));

 

============================

working
============================

 

/*!
 * @brief Select Digital mode.: Enable Digital mode. Digital input is enabled. */
#define PIO1_24_DIGIMODE_DIGITAL 0x01u
/*!
 * @brief Selects pin function.: Alternative connection 1. */
#define PIO1_24_FUNC_ALT1 0x01u
/*!
 * @brief Select Digital mode.: Enable Digital mode. Digital input is enabled. */
#define PIO1_27_DIGIMODE_DIGITAL 0x01u
/*!
 * @brief Selects pin function.: Alternative connection 1. */
#define PIO1_27_FUNC_ALT1 0x01u

    IOCON->PIO[1][24] = ((IOCON->PIO[1][24] &
                          /* Mask bits to zero which are setting */
                          (~(IOCON_PIO_FUNC_MASK | IOCON_PIO_DIGIMODE_MASK)))

                         /* Selects pin function.
                          * : PORT124 (pin F6) is configured as FC2_RXD_SDA_MOSI_DATA. */
                         | IOCON_PIO_FUNC(PIO1_24_FUNC_ALT1)

                         /* Select Digital mode.
                          * : Enable Digital mode.
                          * Digital input is enabled. */
                         | IOCON_PIO_DIGIMODE(PIO1_24_DIGIMODE_DIGITAL));


    IOCON->PIO[1][25] = ((IOCON->PIO[1][25] &
                          /* Mask bits to zero which are setting */
                          (~(IOCON_PIO_FUNC_MASK | IOCON_PIO_DIGIMODE_MASK)))

                         /* Selects pin function.
                          * : PORT127 (pin E8) is configured as FC2_RTS_SCL_SSEL1. */
                         | IOCON_PIO_FUNC(PIO1_27_FUNC_ALT1)

                         /* Select Digital mode.
                          * : Enable Digital mode.
                          * Digital input is enabled. */
                         | IOCON_PIO_DIGIMODE(PIO1_27_DIGIMODE_DIGITAL));

 

 ============================

Thanks.

0 Kudos
Reply
807 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls refer to the IOCON module, I suppose that you have to set the OD bit(bit 9) and the DIGIMODE bit(bit 8), and connect external pull-up resistor.

 

xiangjun_rong_0-1683183409842.png

Pls have a try

BR

XiangJun Rong

 

0 Kudos
Reply
797 Views
lsl
Contributor I

Hi xiangjun, thank you for the reply.

I have attempted to use the suggested pin settings to no improvement.

/* Enables the clock for the IOCON block. 0 = Disable; 1 = Enable.: 0x01u */
CLOCK_EnableClock(kCLOCK_Iocon);

//PIO1_27 FC2_RTS_SCL_SSEL1

#define IOCON_PIO_FUNC1 1

#define IOCON_PIO_OPENDRAIN_EI 0x200

const uint32_t PIO1_27 = (/* Pin is configured as PIO1_27 */
IOCON_PIO_FUNC1 |
/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_EI);

IOCON_PinMuxSet(IOCON, 1, 27, PIO1_27 );

 

Thanks.

0 Kudos
Reply
789 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I think the pin configuration is correct.

On the LPC5528-EVK board, the PIO1_27 is connected to the codec, I do not know if it takes effect on the feature of PIO1_27, pls remove the R24 and have a try.

 

xiangjun_rong_0-1683254615794.png

Hope it can help you

BR

XiangJun Rong

 

0 Kudos
Reply
752 Views
lsl
Contributor I

Hi XiangJun,

                     this was the issue. It now functions.

Thanks!

0 Kudos
Reply