diff options
| author | robert-hh <robert@hammelrath.com> | 2023-01-24 20:36:19 +0100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-02-21 23:15:29 +1100 |
| commit | 76cf98c35b81dded1dc623d07f25e28713a16b63 (patch) | |
| tree | aadcfff5997f4d24522d34bc973eb6e47d165817 /docs | |
| parent | 7e0b1bc95dffad4056ab6a1d6bc54f51cb6a6002 (diff) | |
samd/mcu: Implement a hardware seed for the SAMD21 random module.
By using the phase jitter between the DFLL48M clock and the FDPLL96M clock.
Even if both use the same reference source, they have a different jitter.
SysTick is driven by FDPLL96M, the us counter by DFLL48M. As a random
source, the us counter is read out on every SysTick and the value is used
to accumulate a simple multiply, add and xor register. According to tests
it creates about 30 bit random bit-flips per second. That mechanism will
pass quite a few RNG tests, has a suitable frequency distribution and
serves better than just the time after boot to seed the PRNG.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/samd/quickref.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/samd/quickref.rst b/docs/samd/quickref.rst index aa3d563f7..cdfb0a475 100644 --- a/docs/samd/quickref.rst +++ b/docs/samd/quickref.rst @@ -42,8 +42,10 @@ The :mod:`machine` module:: machine.freq(96_000_000) # set the CPU frequency to 96 MHz The range accepted by the function call is 1_000_000 to 200_000_000 (1 MHz to 200 MHz) -for SAMD51 and 1_000_000 to 48_000_000 (1 MHz to 48 MHz) for SAMD21. The safe -range for SAMD51 according to the data sheet is 96 MHz to 120 MHz. +for SAMD51 and 1_000_000 to 54_000_000 (1 MHz to 54 MHz) for SAMD21. The safe +range for SAMD51 according to the data sheet is up to 120 MHz, for the SAMD21 up to 48Mhz. +Frequencies below 48Mhz are set by dividing 48Mhz by an integer, limiting the number of +discrete frequencies to 24Mhz, 16Mhz, 12MHz, and so on. At frequencies below 8 MHz USB will be disabled. Changing the frequency below 48 MHz impacts the baud rates of UART, I2C and SPI. These have to be set again after changing the CPU frequency. The ms and µs timers are not affected by the frequency |
