One of the common pseudo-random, non-deterministic schemes is to have a free-running timer. You just grab a value when you need a new "number". It will be non-deterministic but might not be truly random in the statistical sense. It will average to the median. Jim Wagner Oregon Research Electronics On Jan 8, 2011, at 1:39 PM, Chuck Hackett wrote: > 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? > > > [Non-text portions of this message have been removed]
Message
Re: [AVR-Chat] Random Number Generator
2011-01-08 by Jim Wagner
Attachments
- No local attachments were found for this message.