25 Random Number Generator (RNG)
25.4 Programming Procedure
When using the random number generator, make sure at least either the SAR ADC or high-speed ADC is enabled.
Otherwise, pseudo-random numbers will be returned.
• SAR ADC can be enabled by using the DIG ADC controller. For details, please refer to Chapter
Sensors and Analog Signal
• High-speed ADC is enabled automatically when the Wi-Fi or Bluetooth modules is enabled.
Note:
Note that, when the Wi-Fi module is enabled, the value read from the high-speed ADC can be saturated in some
extreme cases, which lowers the entropy. Thus, it is advisable to also enable the SAR ADC as the noise source for the
random number generator for such cases.
When using the random number generator, read the
random numbers have been generated. Ensure the rate at which the register is read does not exceed the
frequencies described in section
25.5 Register Summary
Name
RNG_DATA_REG
25.6 Register
The addresses in parenthesis besides register names are the register addresses relative to the RNG base address
provided in Table
1-6
Peripheral Address Mapping in Chapter
addresses are listed in Section
31
RNG_DATA_REG Random number source. (RO)
Espressif Systems
Processing.
RNG_DATA_REG
25.3
above.
Description
Random number data
25.5 Register
Summary.
Register 25.1. RNG_DATA_REG (0x144)
0x000000000
605
Submit Documentation Feedback
register multiple times until sufficient
Address
0x3FF75144
1 System and
Memory. The absolute register
ESP32 TRM (Version 5.2)
29 On-Chip
Access
RO
0
Reset
Need help?
Do you have a question about the ESP32 and is the answer not in the manual?