I want to enable pin 13 on my SAM3X8E using direct port manipulation. On this chip the pin is bit 27 in port B, so I used PIOB->PIO_PER = 1<<27;
to enable this pin, but it doesn't work. This pin keeps at 3.08V, the default value of non-initialized pins.
Here's my complete code:
#include <asf.h>
int main (void) {
// Insert system clock initialization code here (sysclk_init()).
board_init();
sysclk_init();
delay_init(sysclk_get_cpu_hz());
PIOB->PIO_PER = 1<<27;
PIOB->PIO_OER = 1<<27;
while(1) {
REG_PIOB_ODSR = 1<<27;
delay_ms(1000);
REG_PIOB_ODSR = 0<<27;
delay_ms(1000);
}
}
Can anyone tell me how I can get this to work?