[riot-notifications] [RIOT-OS/RIOT] cpu/samd5x: allow more flexible selection of CLOCK_CORECLOCK (#12222)

benpicco notifications at github.com
Fri Sep 13 17:41:23 CEST 2019


### Contribution description

Right now the main clock on samd5x always uses DPLL directly.
According to the data sheet, DPLL must run at at least 96 MHz, so running the CPU at a lower frequency is currently not possible.

There are some constraints to the oscillators on the samd5x.

 - DFLL is fixed to run at 48 MHz
 - DPLL can run at 96 to 200 MHz

This makes the core clock always use DFLL for frequencies <= 48 MHz.
For frequencies >= 96 MHz, it uses DPLL directly as before.
For frequencies < 96 MHz, DPLL is clocked at twice the desired frequency, then a divider is used to reach the target frequency.


### Testing procedure
Configure a different `CLOCK_CORECLOCK` in `boards/same54-xpro/include/periph_conf.h`.

Try, e.g. 8 MHz, 16 MHz or 64 MHz.

### Issues/PRs references
#12037 if you want to use i2c, it is currently necessary to use a lower clock speed.
But a lower clock is also desirable for battery powered devices that don't need the full 120 MHz.

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/12222

-- Commit Summary --

  * cpu/samd5x: allow more flexible selection of CLOCK_CORECLOCK

-- File Changes --

    M cpu/samd5x/cpu.c (30)
    M cpu/samd5x/include/periph_cpu.h (15)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/12222.patch
https://github.com/RIOT-OS/RIOT/pull/12222.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12222
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190913/ec7844ff/attachment.htm>


More information about the notifications mailing list