I am currently using the Atmel Studio 6.1 and the Atmel Software Framework with my Arduino Due. The reason I am doing this is the Arduino IDE keeps a lot of things under the hood that I am trying to see. So, I am using the Atmel Studio 6.1 in order to better learn the Cortex M3 ARM microcontroller.
Unfortunately, the complexity has already gotten the best of me. I searched for the answers myself but came up empty-handed.
What I am basically trying to do is a simple program to toggle a pin, say what is commonly referred to as PIN 13 on the Arduino Due board, which is LED "L". I used the New Project template, specifying the Arduino Due board and also added the GPIO, System Clock, and Delay ASF libraries. I cannot get the LED to flash on and off at a 1 Hz rate, and I am stumped as to why. Here's the body of my main:
int main (void)
pio_set_output(PIOB, LED0_GPIO, HIGH, DISABLE, DISABLE);
// Insert application code here, after the board has been initialized.
I tried some of the other gpio and pio configure and set functions to no avail. It would be nice to have documentation that shows how the ASF relates to the chip itself. For instance, to configure the port bin PB_27 as output, first do this then that. I have yet to find any documentation like this, so I have resorted to trial and error.
Oh, I am also aware that the Atmel database has an example on PWMing PWM Channels 0 and 1 to make an LED glow, but my scope shows nothing is happening. I believe I am programming the board correctly with bossac, as the verify portion of the programming says it was successful.