Random() is much too slow

Apparently the Arduino trng() function spends most of it's time initializing the R4 SCE, and neither the R4 code nor the Renesas-provided code check whether it has already been initialized :frowning:

Initializing the SCE drops the random() time to about 20us.

2 Likes