Hi Bas,

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 [1] -- but would need to branch out in timer_init, and
(when it's a LETIMER) err out if the desired frequency is not 32768.

Christian

[1]: https://github.com/RIOT-OS/RIOT/pull/9878/files

-- 
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom

Attachment: signature.asc
Description: PGP signature

_______________________________________________
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel

Reply via email to