Port A2 : SSIOCLK by default
I want to configure this pin to GPIO in output mode.
Code which i have used
SYSCTL_RCGC2_R |= 0x00000001; // activate clock for Port A
SysCtlDelay(1000); // allow time for clock to start
GPIO_PORTA_AMSEL_R &= ~0x04; // disable analog on PA2
GPIO_PORTA_PCTL_R &= ~0x00000F00; // PCTL GPIO on PA2
GPIO_PORTA_DIR_R |= 0x04; // PA2 out
GPIO_PORTA_AFSEL_R &= ~0x04; // disable alt funct on PA2
GPIO_PORTA_DEN_R |= 0x04; //digital enable
GPIO_PORTA_DATA_R &= ~(0x04); // Zero on PA2
though i made PA2 low , it shows Continuosly high voltage.
Anyone knows what is wrong in my code.