I'm using an AT91SAM7 chip on the MakingThings board for some custom work. To better understand the peripheral driver, I'm trying to directly call/control an output pin (PA12) to turn on the status LED.
main()
{
AT91C_BASE_PIOA->PIO_PER = AT91C_PIO_PA12; //Enable Pin PA12
AT91C_BASE_PIOA->PIO_OER = AT91C_PIO_PA12; // Enable Pin PA12 as 'peripheral manager' controlled pin
AT91C_BASE_PIOA->PIO_PPUDR = AT91C_PIO_PA12; //Disable Pull Up resistors
AT91C_BASE_PIOA->PIO_SODR = AT91C_PIO_PA12; // Set pin state to 'high'
}
That code builds fine. When I burn the firmware and test it, that does not turn on the LED on pin A 12. The peripheral controller is a bit complex, so I'm concerned I'm doing something in a wrong order, or that I am missing some other register that must be set. Does anyone have feedback or info on why that might be wrong?
(I can run other code, do other examples, run USB data, etc. It's just the simple flicking on an LED that is weird).