After finally sorting myself out an Atmel-ICE programmer and a suitable breakout board to allow me to connect to my SAM4S-EK2 dev board, I have finally managed, after a few days of on-off searching for tutorials that will help me with it... managed to turn an LED on!
Now, shortly after this, I followed the tutorial further to get it to blink, however I noticed a problem, the LED seems to blink very -very- slowly compared to what it was meant to.
using the delay library and led library in Atmel's ASF setup I formed this program together:
#include <asf.h>
#include "led.h"
#include "delay.h"
int main (void)
{
/* Insert system clock initialization code here (sysclk_init()). */
board_init();
LED_On(LED1_GPIO);
/* Insert application code here, after the board has been initialized. */
while(1)
{
delay_ms(1000);
LED_Toggle(LED1_GPIO);
}
}
this seems to make it blink at an exceedingly slow rate (on / off for over 30 seconds each?)
if I change the time to 5 I can get it to blink on and off about 2-3 times per second instead, however I cannot seem to work out how to set the frequency correctly (or why it is detecting the incorrect frequency setting considering the IDE knows what board I am running and has some sort of auto-detect code in there that is obviously not working...
Now, does anyone know how I can resolve this issue?
I would also really appreciate any suggested tutorials or readings for continuing on with this, especially in the area of PWM.
Thanks in advance!