AnsweredAssumed Answered

iMX1060: Toggling GPIO3, Pin6 and Pin2

Question asked by Andre marcus on Dec 27, 2019
Latest reply on Jan 5, 2020 by Kerry Zhou

I am wondering why I could not not toggle GPIO3, pin 6 and 2 , while I was able to toggle pin 0 on iMX RT1062 MCU. Below are my initialization. I am assuming all pins on a signal GPIO share same clock. Am I right?

 

 

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

 

  /* GPIO configuration of FlexSPI_D3_B on GPIO_SD_B1_00 (pin L5) */
  gpio_pin_config_t FlexSPI_D3_B_config = {
      .direction = kGPIO_DigitalOutput,
      .outputLogic = 0U,
      .interruptMode = kGPIO_NoIntmode
  };
  /* Initialize GPIO functionality on GPIO_SD_B1_00 (pin L5) */
  GPIO_PinInit(GPIO3, 0U, &FlexSPI_D3_B_config);

 

  /* GPIO configuration of FlexSPI_D1_B on GPIO_SD_B1_02 (pin M3) */
  gpio_pin_config_t FlexSPI_D1_B_config = {
      .direction = kGPIO_DigitalOutput,
      .outputLogic = 0U,
      .interruptMode = kGPIO_NoIntmode
  };
  /* Initialize GPIO functionality on GPIO_SD_B1_02 (pin M3) */
  GPIO_PinInit(GPIO3, 2U, &FlexSPI_D1_B_config);

 

  /* GPIO configuration of FlexSPI_SS0 on GPIO_SD_B1_06 (pin L3) */
  gpio_pin_config_t FlexSPI_SS0_config = {
      .direction = kGPIO_DigitalOutput,
      .outputLogic = 0U,
      .interruptMode = kGPIO_NoIntmode
  };
  /* Initialize GPIO functionality on GPIO_SD_B1_06 (pin L3) */
  GPIO_PinInit(GPIO3, 6U, &FlexSPI_SS0_config);

 

  IOMUXC_SetPinMux(
      IOMUXC_GPIO_SD_B1_06_GPIO3_IO06,        /* GPIO_SD_B1_06 is configured as GPIO3_IO06 */
      0U);                                    /* Software Input On Field: Input Path is determined by functionality */

 

  IOMUXC_SetPinMux(
      IOMUXC_GPIO_SD_B1_00_GPIO3_IO00,        /* GPIO_SD_B1_00 is configured as GPIO3_IO00 */
      0U);                                    /* Software Input On Field: Input Path is determined by functionality */
  IOMUXC_SetPinMux(
      IOMUXC_GPIO_SD_B1_02_GPIO3_IO02,        /* GPIO_SD_B1_02 is configured as GPIO3_IO02 */
      0U); 

  IOMUXC_GPR->GPR26 = ((IOMUXC_GPR->GPR26 &
    (~(IOMUXC_GPR_GPR26_GPIO_MUX1_GPIO_SEL_MASK))) /* Mask bits to zero which are setting */
      | IOMUXC_GPR_GPR26_GPIO_MUX1_GPIO_SEL(0x00U) /* GPIO1 and GPIO6 share same IO MUX function, GPIO_MUX1 selects one GPIO function: 0x00U */
    );
  IOMUXC_GPR->GPR28 = ((IOMUXC_GPR->GPR28 &
    (~(IOMUXC_GPR_GPR28_GPIO_MUX3_GPIO_SEL_MASK))) /* Mask bits to zero which are setting */
      | IOMUXC_GPR_GPR28_GPIO_MUX3_GPIO_SEL(0x00U) /* GPIO3 and GPIO8 share same IO MUX function, GPIO_MUX3 selects one GPIO function: 0x00U */
    );

}

main()

{

    while (1)
    {
        delay();
        GPIO_PortToggle(GPIO3, 1u<<2);
        GPIO_PortToggle(GPIO3, 1u<<6);
        GPIO_PortToggle(GPIO3, 1u<<0);

}

 

Any comments?

Thank you!

Outcomes