[riot-devel] EFM32 timers, PWM and xtimer
chrysn at fsfe.org
Mon Nov 12 19:28:12 CET 2018
thanks for your quick response!
On Mon, Nov 12, 2018 at 05:54:09PM +0100, Bas Stottelaar wrote:
> The newer chips have an additional 32-bit timer with the same problem, but
> this frees up timers for PWM.
That unfortunately won't help with the hardware I have here right now :-/
> The two timers are needed, because they run in cascade mode. Only that way,
> I can generate values for XTIMER_HZ that have sufficient resolution.
As I understand, the timer that serves XTIMER needs to be precise 1MHz,
and may be up to 6 shifts away from it -- but there is also the option
of running it from a 32768Hz clock available as internal and often
external clock. That seems to be sufficient xtimer resolution for some
applications (it certainly is for mine).
Options are a bit limited as to how to implement such a clock without
moving the whole device on the low frequency clock (HFPERCLK TIMERn can
only be clocked from LFxO if all HF stuff actually uses that in
HFCLKSEL), but the LETIMER0 (or RTC, but LETIMER is unused) would be an
option here (provided LFACLK comes from an LFxO).
If LETIMER support were to be added, it could probably look similar to
the changes in  -- but would need to branch out in timer_init, and
(when it's a LETIMER) err out if the desired frequency is not 32768.
To use raw power is to make yourself infinitely vulnerable to greater powers.
-- Bene Gesserit axiom
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the devel