2018-01-31 12:50 AM
Hello.
dose anybody have any code or library to generate true random number in stm32f030?
2018-01-31 03:15 AM
many possible approaches, two come to my mind:
1) use two clocks to gate each other. at least one of them is an R/C oscillator. this approach relies on the phase noise of an r/c oscillator.
one example on STM32F100 here:
it uses the slow 40Khz LSI to gate HSI/HSE. and can be easily ported to your chip: DWT isn't available but SysTick will do as well.
2) use the adc's lsb. you can adc any voltage source, floating, real, or even the temperature sensor / reference. it can be very fast.