Nai 's depot

Thursday, June 5, 2014

C-programming AVR-Timer

XMEGA-A1 XPLAINED

Use the code shown to figure out the Peripheral Clock that drives the timer if it's not obvious or you don't want to read the manual.

The peripheral clock on the XMEGA-A1-XPLAINED can be driven by 5 different clock sources and it can be scaled 3 times before it gets to the timer module.

By default the clock = 2 MHz and all prescaler are set to 1.


To set the desired time:
            1) change the 16 bit timer period (TCC0.PER),
            2) change the clock scaling (TC_CLKSEL_DIVx_gc)


















No comments:

Post a Comment