Having a bit of trouble with using the ASF4 TC peripheral driver I call "TIMER" to wakeup a SAMD20 at the interval I want.
I am using Atmel START web-based software configuration tool (AtmelStudio 7) on a SAMD20 device. Within my configuration I setup peripherals called SLEEP_MANAGER, CALENDAR, and TIMER. I want to wake-up the MCU from deep sleep with TIMER because I want to program different time interval as needed...I may want to sleep the MCU up to 1 week or more. Here is an overview of my configuration:
- OSC32K drives GCLK1 divided down to 1.024kHz (1K enabled, 32kHz output enabled)
- GCLK1 drives TIMER which I divided again by 1024 within the driver settings to give 1Hz clock.
- Length of one timer tick is set to 1024 micro seconds. How is timer tick utilized?
- 'Run in Standby' is set for TIMER and associated clocks (GCLK1 & OSC32K).
- I set my TIMER task in main.c configuration function to an interval of 10 and mode REPEAT with a callback function
With this configuration the MCU awakes every 1 second. At the 10 second mark per the interval, the callback function is called, this process then repeats. I increase the interval to 100, 1000 or more and the MCU stills wakes every 1 second (call back fires according to the interval). I want to wake the MCU at my timer interval not at 1 second and not just call the callback function. Yet that does not appear to the behavior of this driver. The abstraction of Atmel START make is somewhat difficult to see what is going on "under the hood", especially when it comes to how TIMER fires its interrupts. Has anyone had experience with using the web-base tool to properly configure the TC peripheral driver to behave in the way I am seeking? Here is a capture of the driver configuration within the web-based tool.