This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RANG timing spec?

It looks like the random number generator is relative slow as implied by the documents. I wonder if it has been spec'ed some where? Exactly how much time does it take to generate a byte? Or at least some idea of worst case timing? It seems important to know that if we have to wait in a while loop waiting for random bytes to be available.

Parents
  • Hi,

    What chip are you looking at? We have numbers for the nRF51 in the Product spec v3.3:

    imgage

    Values for the nRF52 can be found here.

    Both chips also have an event register called VALRDY that you can use to get notified for every new random number written to the VALUE register.

    A simple way to use it is like this:

    while(NRF_RNG->EVENTS_VALRDY != 1)
    {
        // Do nothing, but wait
    }
    
  • Oh thanks. I didn't look the electrical spec. I'm using 52832.

    The question is still about the worse case scenario. Can I say if the typical time to generate one byte is 120us, then it'll take 1.2ms to generate 10 bytes? If occasionally it takes, say 3ms to generate 1 byte then the total time will be so much different. It seems very undeterministic. How should I think about this from deisgn perspective. Particularly I need to do this in between connection interval. A few ms variation will be pretty big impact on design.

Reply
  • Oh thanks. I didn't look the electrical spec. I'm using 52832.

    The question is still about the worse case scenario. Can I say if the typical time to generate one byte is 120us, then it'll take 1.2ms to generate 10 bytes? If occasionally it takes, say 3ms to generate 1 byte then the total time will be so much different. It seems very undeterministic. How should I think about this from deisgn perspective. Particularly I need to do this in between connection interval. A few ms variation will be pretty big impact on design.

Children
No Data
Related