nRF51 SDK - S120 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Random Number Generator Example

The Random Number Generator (RNG) Example demonstrates the use of the RNG peripheral by obtaining a random number and printing it in a COM listener (for example PUTTY) using UART.

The application starts by configuring simple_uart and starting the RNG peripheral. The main loop prints the random number and waits for 100 milliseconds.

The name of the example is rng_pca10028. If you are not using the Keil Pack Installer, you can find the source code and project file of the example in the following folder: <InstallFolder>\Nordic\nrf51\examples\peripheral\rng

Testing

Test the Random Number Generator Example application by performing the following steps:

  1. Compile and program the application.
  2. Start a COM listener like PUTTY and connect to the used COM port at 38400 baud rate.
  3. Observe that a random number is updated every 100 milliseconds.