Quantcast
Channel: Infineon Forums
Viewing all articles
Browse latest Browse all 9892

Example for PRNG

$
0
0
it seems that the DAC of XMC4500 can be used for the same purpose. However, there is so sample code about this. The documentation is also very limited in the reference manual.


Quote:

Originally Posted by chismo View Post
Hello,

With the PRNG XMC lib, it is quite easy.
The PRNG configuration needs to be defined first:
Code:

/* PRNG configuration */
XMC_PRNG_INIT_t prng_config =
{
  .block_size = XMC_PRNG_RDBS_WORD,
  .key_words = 5
};

And after the PRNG is initialized with the defined configuration, the random data can be read.
Code:

        /* Initialize PRNG */
        XMC_PRNG_Init(&prng_config);

        /* Read into a variable */
        random_data = XMC_PRNG_GetPseudoRandomNumber();

The file "xmc_prng.h" must be included of course.

Regards,
Min Wei


Viewing all articles
Browse latest Browse all 9892

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>