Multiplex configured the GPIO_ AD0 as a normal GPIO (RT1011)

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

Multiplex configured the GPIO_ AD0 as a normal GPIO (RT1011)

Jump to solution
496 Views
TOM888
Contributor I

Hi,

On the RT1011 chip, I want to multiplex configure the GPIO_ AD0 as a normal GPIO port to output the high or low electrical Level. Could you please provide me an example or some reference documents.

 

Thanks.

0 Kudos
1 Solution
473 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @TOM888,

You could choose the GPIO functionality like follows:

MCUXpresso IDE ConfigTools (MCUXpresso ConfigTools)

  • First, import an SDK example or create a new project.
  • Second, go to Pins view in ConfigTools

RaulRomero_0-1682709489901.png

  • Then, choose the project you are working with.

RaulRomero_1-1682709489903.png

  • After that, search for GPIO_AD0's pins

RaulRomero_2-1682709489905.png

  • Next, select the pins one by one and choose the pin functionality you want to use.

RaulRomero_3-1682709489911.png

Note: You could modify some pin's characteristics in Routing Details

RaulRomero_4-1682709489915.png

  • Finally, update your code and go back to your workspace.

RaulRomero_5-1682709489917.png

RaulRomero_6-1682709489918.png

MCUXpresso IDE (Code)

You could change or choose the functionality of each one of the GPIO_AD0 pins changing the IOMUXC and GPIO registers. In the following example, we show you how to write the GPIO_AD0_9 to GPIO1: GPIOMUX_IO23 as Output:

pin_mux.c

/* GPIO configuration of ADC12_4 on GPIO_AD_09 (pin 48) */
 gpio_pin_config_t ADC12_4_config = {
     .direction = kGPIO_DigitalOutput,
     .outputLogic = 0U,
     .interruptMode = kGPIO_NoIntmode
};

/* Initialize GPIO functionality on GPIO_AD_09 (pin 48) */
GPIO_PinInit(GPIO1, 23U, &ADC12_4_config);

IOMUXC_SetPinMux(IOMUXC_GPIO_AD_09_GPIOMUX_IO23, 0U);
IOMUXC_GPR->GPR26 = ((IOMUXC_GPR->GPR26 & (~(BOARD_INITPINS_IOMUXC_GPR_GPR26_GPIO_SEL_MASK))) | IOMUXC_GPR_GPR26_GPIO_SEL(0x00U));

pin_mux.h

#define BOARD_INITPINS_IOMUXC_GPR_GPR26_GPIO_SEL_MASK 0x800000U /*!< Select GPIO1 or GPIO2: affected bits mask */

/* GPIO_AD_09 (number 48), ADC12_4/JTAG_TDO/J55[6]/J26[4] */
/* Routed pin properties */
#define BOARD_INITPINS_ADC12_4_PERIPHERAL    GPIO1   /*!< Peripheral name */
#define BOARD_INITPINS_ADC12_4_SIGNAL       gpiomux_io   /*!< Signal name */
#define BOARD_INITPINS_ADC12_4_CHANNEL          23U   /*!< Signal channel */

Let us know if this helps you.

Best regards, Raul.

View solution in original post

0 Kudos
2 Replies
429 Views
TOM888
Contributor I

Hi, Raul,

Thanks for the detailed explanation, this topic has been resolved.

Best regards!

 

0 Kudos
474 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @TOM888,

You could choose the GPIO functionality like follows:

MCUXpresso IDE ConfigTools (MCUXpresso ConfigTools)

  • First, import an SDK example or create a new project.
  • Second, go to Pins view in ConfigTools

RaulRomero_0-1682709489901.png

  • Then, choose the project you are working with.

RaulRomero_1-1682709489903.png

  • After that, search for GPIO_AD0's pins

RaulRomero_2-1682709489905.png

  • Next, select the pins one by one and choose the pin functionality you want to use.

RaulRomero_3-1682709489911.png

Note: You could modify some pin's characteristics in Routing Details

RaulRomero_4-1682709489915.png

  • Finally, update your code and go back to your workspace.

RaulRomero_5-1682709489917.png

RaulRomero_6-1682709489918.png

MCUXpresso IDE (Code)

You could change or choose the functionality of each one of the GPIO_AD0 pins changing the IOMUXC and GPIO registers. In the following example, we show you how to write the GPIO_AD0_9 to GPIO1: GPIOMUX_IO23 as Output:

pin_mux.c

/* GPIO configuration of ADC12_4 on GPIO_AD_09 (pin 48) */
 gpio_pin_config_t ADC12_4_config = {
     .direction = kGPIO_DigitalOutput,
     .outputLogic = 0U,
     .interruptMode = kGPIO_NoIntmode
};

/* Initialize GPIO functionality on GPIO_AD_09 (pin 48) */
GPIO_PinInit(GPIO1, 23U, &ADC12_4_config);

IOMUXC_SetPinMux(IOMUXC_GPIO_AD_09_GPIOMUX_IO23, 0U);
IOMUXC_GPR->GPR26 = ((IOMUXC_GPR->GPR26 & (~(BOARD_INITPINS_IOMUXC_GPR_GPR26_GPIO_SEL_MASK))) | IOMUXC_GPR_GPR26_GPIO_SEL(0x00U));

pin_mux.h

#define BOARD_INITPINS_IOMUXC_GPR_GPR26_GPIO_SEL_MASK 0x800000U /*!< Select GPIO1 or GPIO2: affected bits mask */

/* GPIO_AD_09 (number 48), ADC12_4/JTAG_TDO/J55[6]/J26[4] */
/* Routed pin properties */
#define BOARD_INITPINS_ADC12_4_PERIPHERAL    GPIO1   /*!< Peripheral name */
#define BOARD_INITPINS_ADC12_4_SIGNAL       gpiomux_io   /*!< Signal name */
#define BOARD_INITPINS_ADC12_4_CHANNEL          23U   /*!< Signal channel */

Let us know if this helps you.

Best regards, Raul.

0 Kudos