This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Unabled to set GPIO

Hi,

I am working on modifying the mcaspPlayBk from StarterWare for L138 to work on my board. One strange problem I am having is I can't set an GPIO pin. Here is how the GPIO is setup.

#define PINMUX0_GPIO6_0__ENABLE    (SYSCFG_PINMUX19_PINMUX19_27_24_GPIO6_0 << SYSCFG_PINMUX19_PINMUX19_27_24_SHIFT) 
#define GPIO6_DIR (volatile unsigned int*)(0x01e26088)
#define GPIO6_SET (volatile unsigned int*)(0x01e26090)
#define GPIO6_CLR (volatile unsigned int*)(0x01e26094)
{
savePinMux = HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(19)) &  ~SYSCFG_PINMUX19_PINMUX19_27_24;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(19)) =  PINMUX0_GPIO6_0__ENABLE | savePinMux;
*GPIO6_DIR &= ~( 1<<0 ); 
*GPIO6_SET = 1<<0;
//GPIOPinWrite(SOC_GPIO_0_REGS, 97, 1);
}

PINMUX appears to be correct, But the GPIO never seemed to be set. Is there anything I missed?

 

Thanks

  • Looks all correct. Possibly the power and clock has not not enabled for the GPIO module. Either in GEL and code, there should be something like:

    PSCModuleControl(SOC_PSC_1_REGS,
                       HW_PSC_GPIO,
                       PSC_POWERDOMAIN_ALWAYS_ON,
                       PSC_MDCTL_NEXT_ENABLE);