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.

configure GPIO on ARM problem?

I'm configuring GPIO Bank7 - PIN 9 as output pin . i have noticed that i can't access the PINMUX 17 register although i used unlock function named (SysCfgRegistersUnlock) .

could anyone tell me if this steps is wrong ,

1- i don't use SYS/BIOS as it will enable MMU at loading .

2- i'm using starterware ,CCS V5.1,OMAPL 138 ,developing on ARM9.

3 - here is my code :

#define GPIO7P9 122u

#define PINMUX17_GPIO7_9_ENABLE (SYSCFG_PINMUX17_PINMUX17_3_0_GPIO7_9 << \
SYSCFG_PINMUX17_PINMUX17_3_0_SHIFT)

void main()

{

unsigned int savePinmux = 0;

 SysCfgRegistersUnlock();

/* configure pin 122 as GPIO PIN*/

savePinmux = (HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(17)) & ~(SYSCFG_PINMUX17_PINMUX17_3_0));

/* Setting the pins corresponding to GP7[9] in PINMUX17 register.*/
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(17)) = (PINMUX17_GPIO7_9_ENABLE | savePinmux);

 /* The Local PSC number for GPIO is 3. GPIO belongs to PSC1 module.*/

PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_GPIO, PSC_POWERDOMAIN_ALWAYS_ON,PSC_MDCTL_NEXT_ENABLE);

GPIODirModeSet(SOC_GPIO_0_REGS, GPIO7P9, 0); // Set Pin direction
GPIOIntTypeSet(SOC_GPIO_0_REGS, GPIO7P9, GPIO_INT_TYPE_NOEDGE); // Configure no interrupt
GPIOPinWrite(SOC_GPIO_0_REGS,GPIO7P9,0); // Initial Pin value

while (1)

   {

     GPIOPinWrite(SOC_GPIO_0_REGS,GPIO7P9,1); // Initial Pin value

     GPIOPinWrite(SOC_GPIO_0_REGS,GPIO7P9,0); // Initial Pin value

   }

}


thanks in advance.