Yahoo Groups archive

AVR-Chat

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

Message

Re: Random Number Generator

2011-01-10 by Eugene

In my humble opinion the best way is using the noise of p-n transition, well let it be 2 OPs more in one soic8 (for example) and some additional smd components - it's much better than floating inputs.
If you are going to use them you should eliminate possible regular external influences (just in mind: for example you have a rotating radar not far from your equipment and you'll have a regular EM influence on your floating inputs). That may break down randomness of spontaneous signal :)

A few time ago my PCB manufacturer made unconditional PCBs with bad vias. There is an analog part to operate in uVs and we had spontaneous noises in signal - just move a hand over the working board. That's about floating or semi-floating inputs.

Best regards,
Eugene.

--- In AVR-Chat@yahoogroups.com, "Chuck Hackett" <egroupscdh@...> 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?
>

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.