Using ATSAMD21G18, output pin is working, main while loop working, tried debugging, none of the timer tasks or external interrupt functions execute!!!!!
This is driving me crazy, not sure what to do next.
Here's the driver code, ANY execution should switch PA01 to 1, light up the LED, put my scope on high, ...all that. In fact, NOTHING HAPPENS!!!! Not my first rodeo with Atmels, my first rodeo with ATSAMD21.
/* * Code generated from Atmel Start. * * This file will be overwritten when reconfiguring your Atmel Start project. * Please copy examples or other code you want to keep to a separate file * to avoid losing it when reconfiguring. */ #include "driver_examples.h" #include "driver_init.h" #include "utils.h" static void button_on_PA04_pressed(void) { REG_PORT_OUTSET0 = PORT_PA01; // REG_PORT_OUTCLR0 = PORT_PA01; } static void button_on_PA05_pressed(void) { REG_PORT_OUTSET0 = PORT_PA01; // REG_PORT_OUTCLR0 = PORT_PA01; } static void button_on_PB22_pressed(void) { REG_PORT_OUTSET0 = PORT_PA01; // REG_PORT_OUTCLR0 = PORT_PA01; } /** * Example of using EXTERNAL_IRQ_0 */ void EXTERNAL_IRQ_0_example(void) { ext_irq_register(PIN_PA04, button_on_PA04_pressed); ext_irq_register(PIN_PA05, button_on_PA05_pressed); ext_irq_register(PIN_PB22, button_on_PB22_pressed); } static struct timer_task TIMER_0_task1, TIMER_0_task2; /** * Example of using TIMER_0. */ static void TIMER_0_task1_cb(const struct timer_task *const timer_task) { REG_PORT_OUTSET0 = PORT_PA01; // REG_PORT_OUTCLR0 = PORT_PA01; } static void TIMER_0_task2_cb(const struct timer_task *const timer_task) { REG_PORT_OUTSET0 = PORT_PA01; // REG_PORT_OUTCLR0 = PORT_PA01; } void TIMER_0_example(void) { TIMER_0_task1.interval = 100; TIMER_0_task1.cb = TIMER_0_task1_cb; TIMER_0_task1.mode = TIMER_TASK_REPEAT; TIMER_0_task2.interval = 200; TIMER_0_task2.cb = TIMER_0_task2_cb; TIMER_0_task2.mode = TIMER_TASK_REPEAT; timer_add_task(&TIMER_0, &TIMER_0_task1); timer_add_task(&TIMER_0, &TIMER_0_task2); timer_start(&TIMER_0); }