| ??? 04/22/03 22:04 Read: times |
#43958 - RE: Random Number ( in software)/ERIC Responding to: ???'s previous message |
The time between power up and the first zero crossing in the mains is very random. You could consider feeding the mains frequency to an external interrupt pin through a schmidt trigger. This also gives you a "free" (as in not much cost) periodical interrupt without the need for a timer.
After startup, you measure the time it takes for the first zero crossing to come along, et voila. A seed for the random generator. That is, if your device isn't battery operated of course... If I were you (which I'm not :-) I wouldn't call the pseudo random repeatedly in a loop until it gives out 1, because the sequence is probably repetitive. Call it once, and use the value you get as a time constant. |
| Topic | Author | Date |
| Random Number ( in software) | 01/01/70 00:00 | |
| RE: Random Number ( in software) | 01/01/70 00:00 | |
| RE: Random Number ( in software) | 01/01/70 00:00 | |
| RE: Random Number ( in software) | 01/01/70 00:00 | |
| RE: Random Number ( in software) | 01/01/70 00:00 | |
| RE: Random Number ( in software) | 01/01/70 00:00 | |
| RE: Random Number ( in software) | 01/01/70 00:00 | |
| RE: Random Number ( in software) | 01/01/70 00:00 | |
| RE: Random Number ( in software) | 01/01/70 00:00 | |
| RE: Random Number ( in software) | 01/01/70 00:00 | |
| RE: Random Number ( in software) | 01/01/70 00:00 | |
| RE: Random Number ( in software) | 01/01/70 00:00 | |
| RE: Random Number ( in software)/ Hans | 01/01/70 00:00 | |
| RE: Random Number ( in software)/ Hans | 01/01/70 00:00 | |
| RE: Random Number ( in software)/ERIC | 01/01/70 00:00 | |
| RE: Random Number ( in software)/ERIC | 01/01/70 00:00 | |
RE: Random Number ( in software)/ | 01/01/70 00:00 |



