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

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

The application starts by configuring app_uart and the RNG driver. The main loop prints the vector of random numbers 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>\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 with the following UART settings:
    • Baud rate: 38.400
    • 8 data bits
    • 1 stop bit
    • No parity
    • HW flow control: RTS/CTS
  3. Observe that a vector of random numbers is output every 100 milliseconds.