Atmel SAM4L-EK Atmel ATSAM4L-EK ATSAM4L-EK Data Sheet

Product codes
ATSAM4L-EK
Page of 1204
950
42023E–SAM–07/2013
ATSAM4L8/L4/L2
35. True Random 
Number 
Generator (TRNG)
Rev: 1.0.3.0
35.1
Features
Passed NIST Special Publication 800-22 Tests Suite
Passed Diehard Random Tests Suite
Provides a 32-bit Random Number Every 84 Clock Cycles
35.2
Overview
The True Random Number Generator provides 32-bit random numbers.
35.3
Functional Description
The True Random Number Generator (TRNG) passes the American NIST Special Publication
800-22 and Diehard Random Tests Suites.
As soon as the TRNG is enabled (writing the ENABLE bit in the CR register with the correct
KEY), the generator provides one 32-bit value every 84 clock cycles. An Interrupt can be
enabled through the IER register (respectively disabled in IDR). This interrupt is set when a new
random value is available and is cleared when the Interrupt Status Register is read (ISR). The bit
DATRDY in ISR is set when the random data is ready to be read out on the 32-bit output data
register (ODATA).
The user should check that the DATRDY bit is one before readin the ODATA register when a 32-
bit random value is required.
Figure 35-1. TRNG Data Generation Sequence
84 clock cycles
84 clock cycles
84 clock cycles
Read TRNG_ISR
Read TRNG_ODATA
Read TRNG_ISR
Read TRNG_ODATA
clock
trng_int
trng_cr
enable