is it possible to use one GCLK for more peripherals?
The ATSAMD09C13 have six GCLK Generators but this isn´t enougth.
This example works:
GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID(SERCOM0_GCLK_ID_CORE) |
GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN(0);
This example, with two ID´s doesn´t work:
GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID(SERCOM0_GCLK_ID_CORE) | GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_WDT) |
GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN(0);
Exist a way to solve this or is this not possible?
In register
GCLK_CLKCTRLthe fieldIDis not a bit mask but holds the number of the peripheral you want to configure. you cannot combine them byORing multiple IDs.Instead configure each device separately:
Here is some code generated by Harmony3 to provide
GCLK0/GCLK1to multiple devices: