Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Random Number Generator

2011-01-08 by Chuck Hackett

This is mostly a "mind experiment" because I don't have a current need but, is there
a way to obtain a truly random (8-bit is good enough) number on an AVR?  I'm not
talking "random" in the statistically pure sense, just non-deterministic.

I'm only thinking of using it on startup.  

Sampling a "noisy diode" would be great but I want to do it without having to add
external hardware or dedicate an I/O pin to the effort. 

All I can think of is something like setting up one of the analog inputs as 'free
floating', turning the gain all the way up, and violating all the "how to avoid ADC
noise" rules and taking a sample.

I don't think the timers would be helpful because these would tend to be
deterministic and, by nature, run in sync with any code that would be sampling them.


Ideas?

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.