Generating seed value for random number generator
I'm using a SX28, and need to generate a seed value (~1-9) for a random number generator - should be the lowest part count possible (need I mention this?).· I was thinking about using some sort antenna, and sampling the voltage level of the signal when the SX needed the seed value.· Maybe I'm getting too complicated - anyone made anything simple to produce a random number seed?
Nate
Nate
Comments
Well if you want a hardware solution, you could pick up one of the RLP-434 receivers from www.sparkfun.com They are just under $12.00 a set (transmitter/receiver), but I believe you can just purchase the receiver for around $6.00
With out any kind of preamble or header detection, these things output all sorts of random junk when the transmitter is not transmitting. Use serin to grab a byte at 1200 or 2400 baud. I'll bet you'll never get the same byte twice in 50 or so samples.
Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"OEM NMEA GPS Module" Now available on ebay for only $17.49
Product web site: http://www.allsurplus.net/Axiom/
If you have a clock, just take the "seconds" or factional seconds at the time you need the seed. The same could be done with a counter or input if they would be sufficiently "random" to be a good seed, or a good multiplier / divisor for some math to a "fixed" seed.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John R.
8 + 8 = 10
I like the·reciever idea, though I'm thinking simpler, such as a wire antenna and op-amp.
Nate
Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"OEM NMEA GPS Module" Now available on ebay for only $17.49
Product web site: http://www.allsurplus.net/Axiom/
Post Edited (Mike Cook) : 2/18/2006 12:32:04 AM GMT
Do you really want/need a new "seed" every 5 seconds, or just at each start up. Once you give the first seed, the sequence of "what comes next" will vary with each different seed. "Normally" you just want a different seed each time the system sees a "cold start".
If this is what you're after, how about just adding a real time clock (not the system clock) and then use the seconds and/or fractions? This would seem easier than the antenna concept.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John R.
8 + 8 = 10