Searching \ for '[PIC]: Generating a "truly" random number on the a' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/math/index.htm?key=random
Search entire site for: 'Generating a "truly" random number on the a'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Generating a "truly" random number on the a'
2001\08\16@131921 by Tony Pan

picon face
Hi,

In our project, several identical boards are connected together. Normally,
on the application of power, they will be turned on at the same time and
starting running at the same time. But we don't want that to happen. If all
boards are running at the same time, they will consume too much power and
cause a problem.

So, we want to impose a lockout time at the beginning of the software; the
lockout time should be random for each board (though they use the same
software). Only after the lockout time expires would the program start
running. Thus the boards will start at different time and won't cause a
power shortage.

My question is: how to generate a "truly" random number on the application
of power. The number should not be determined upon the compilation of the
software, but should be upon the initial powerup of the chip. (Or, it should
be determine by each individual chip.)

Help?

(By the way, I write my program in C and use PICC compiler.)

Thanks in advance.

Tony Pan

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\16@133153 by Dipperstein, Michael

face picon face
Why not just delay the application of power to each board?  If you have a
control pin to spare, you can build a system that where it's the job of each
board to allow power to flow to the next.

In any random number scheme, you still have the possibility that all generators
will generate the same number and come up at the same time.  This can't happen
when it's the job of one board to apply power to the next.

-Mike


{Original Message removed}

2001\08\16@134347 by Tony Pan

picon face
Mike,

I guess it's more economic to do it in software rather than in hardware.
(It's a commercial product.)

It 's OK to allow a handful of boards to start at the same time. What we
want to avoid is that all the boards (20, 30 or more) to start at the same
time.

Tony

----- Original Message -----
From: "Dipperstein, Michael" <spam_OUTmdippersTakeThisOuTspamHARRIS.COM>
To: <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
Sent: Thursday, August 16, 2001 1:26 PM
Subject: Re: [PIC]: Generating a "truly" random number on the application of
power


> Why not just delay the application of power to each board?  If you have a
> control pin to spare, you can build a system that where it's the job of
each
> board to allow power to flow to the next.
>
> In any random number scheme, you still have the possibility that all
generators
> will generate the same number and come up at the same time.  This can't
happen
> when it's the job of one board to apply power to the next.
>
> -Mike
>
>
> {Original Message removed}

2001\08\16@134821 by Nikolai Golovchenko

flavicon
face
Tony,

You could try to use a few unitialized RAM locations. On power-up,
they would probably contain random values. But the problem is that
the compiler clears all registers on power-up, so the start-up
routine should be modified, which might be tricky though...

Nikolai

Tuesday, August 14, 2001, 10:17:59 AM, Tony Pan wrote:
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\16@140644 by Douglas Butler

flavicon
face
If you give each unit a serial number in ROM you can use that to delay
the start.  Dallas makes tiny one wire interfaced chips that have serial
numbers in them that are guaranteed to be unique.

Sherpa Doug

> {Original Message removed}

2001\08\16@141532 by Tony Pan

picon face
We use Microchip PIC16C711. How (if possible) can we give each unit a serial
number in ROM?

----- Original Message -----
From: "Douglas Butler" <dbutlerspamKILLspamIMETRIX.COM>
To: <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU>
Sent: Thursday, August 16, 2001 1:56 PM
Subject: Re: [PIC]: Generating a "truly" random number on the application of
power


> If you give each unit a serial number in ROM you can use that to delay
> the start.  Dallas makes tiny one wire interfaced chips that have serial
> numbers in them that are guaranteed to be unique.
>
> Sherpa Doug
>
> > {Original Message removed}

2001\08\16@142406 by uter van ooijen & floortje hanneman

picon face
> My question is: how to generate a "truly" random number on the application
> of power. The number should not be determined upon the compilation of the
> software, but should be upon the initial powerup of the chip. (Or, it
should
> be determine by each individual chip.)

You program each chip, so how about compiling anew for each chip with
something like -DSERIAL=nnn where you set nnn to for instance increment for
each chip? It could all be automated easily (for instance with tcl or
python) as part of the programming process. Or use programming software that
allows you to modify the hex file on the fly from the command line (does
such programing software exist?).

Wouter van Ooijen

van Ooijen Technische Informatica: http://www.xs4all.nl/~wf/
Jal compiler for PIC uC's:  http://www.xs4all.nl/~wf/wouter/pic/jal

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\16@143358 by Tony Pan

picon face
I believe we will make tens of thousands of this product. Can't compile each
time. It will work me to death. :)


{Original Message removed}

2001\08\16@145041 by Bob Ammerman

picon face
mChip, your distributor, and the Promate software can all serialize your
chips as they are burned.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)


{Original Message removed}

2001\08\16@151751 by Scott Newell

flavicon
face
How about timing the watchdog reset period and using that as a seed for a
PRNG?

newell

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\16@161021 by wzab

flavicon
picon face
On Thu, Aug 16, 2001 at 02:13:56PM -0400, Tony Pan wrote:
[...]
Responding to the question from the subject:
16C711 has A/D converters, you can connect a simple noise generator
(Zenner+resistor+amplifier) to it and get the really random numbers
(probably not equally distributed, but anyway random)
--
                             Wojciech M. Zabolotny
       http://www.ise.pw.edu.pl/~wzab  <--> EraseMEwzabspam_OUTspamTakeThisOuTise.pw.edu.pl

http://www.ise.pw.edu.pl/~wzab/picadc/picadc.html - Build your FREE Data
                                                   Acquisition System

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\16@163516 by Dale Botkin

flavicon
face
My programmer (MicroEngineerin Labs EPIC+) has software with a provision
for serializing chips.  It will insert an incrementing serial number in
program or EEPROM space automagically.

On Thu, 16 Aug 2001, Tony Pan wrote:

{Quote hidden}

> > > {Original Message removed}

2001\08\16@181024 by mike

flavicon
face
I think the best bet would be to time the WDT period against the
crystal/resonator, as this will vary slightly from part to part and
with voltage and temperature. Using TMR0, you can measure the period
to 1uS at 4MHz, i.e. about 0.005% of the nominal WDT period - it is
reasonable to assume that WDT periods will not be matched to this
degree.

I'd do it like this  :
On reset : Check STATUS to determine if reset was power-up or WDT:

If Power-up :   Set TMR0 to internal clock, no prescale.   Allow WDT to time out.

If WDT timeout :   TMR0 should contain a fairly random value, at least in the lowest
few bits.

If you want more randomness, increase the WDT prescaler setting, to
measure a longer measurement period. The TMR0 register may also have initialised randomly as well, which
will help.


On Tue, 14 Aug 2001 13:17:59 -0400, you wrote:

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\16@210631 by Olin Lathrop

face picon face
> My question is: how to generate a "truly" random number on the application
> of power. The number should not be determined upon the compilation of the
> software, but should be upon the initial powerup of the chip. (Or, it
should
> be determine by each individual chip.)

Sounds like you DON'T want a random number, but rather a predetermined
staggered startup delay.  With truly random numbers there is a finite
probability that all boards will power up within some interval that will
overload the power supply.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, KILLspamolinKILLspamspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\16@215908 by Tony Pan

picon face
The possibility is there. That's why we want to have a good "random" number
so that the starting time can be distributed as widely as possible within a
certain window to reduce the possibility.

There is no way we can stagger the starting time for the boards have no
communications among themselves.

{Original Message removed}

2001\08\16@221042 by David VanHorn

flavicon
face
At 09:57 PM 8/16/01 -0400, Tony Pan wrote:
>The possibility is there. That's why we want to have a good "random" number
>so that the starting time can be distributed as widely as possible within a
>certain window to reduce the possibility.
>
>There is no way we can stagger the starting time for the boards have no
>communications among themselves.

By definition, microcontrollers can't do anything "random".

You might be better off, installing controls on the power lines, so that
you can handle this deterministically, and you aren't burdening the product
with anything that it dosen't need in real life.

--
Dave's Engineering Page: http://www.dvanhorn.org

I would have a link to http://www.findu.com/cgi-bin/find.cgi?KC6ETE-9 here
in my signature line, but due to the inability of sysadmins at TELOCITY to
differentiate a signature line from the text of an email, I am forbidden to
have it.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\16@222816 by Tony Pan

picon face
Sounds like a good idea. I will experiment it.

Thanks.

----- Original Message -----
From: "Mike Harrison" <RemoveMEmikeTakeThisOuTspamWHITEWING.CO.UK>
To: <spamBeGonePICLISTspamBeGonespamMITVMA.MIT.EDU>
Sent: Thursday, August 16, 2001 6:11 PM
Subject: Re: [PIC]: Generating a "truly" random number on the application of
power


I think the best bet would be to time the WDT period against the
crystal/resonator, as this will vary slightly from part to part and
with voltage and temperature. Using TMR0, you can measure the period
to 1uS at 4MHz, i.e. about 0.005% of the nominal WDT period - it is
reasonable to assume that WDT periods will not be matched to this
degree.

I'd do it like this  :

On reset :
Check STATUS to determine if reset was power-up or WDT:

If Power-up :
 Set TMR0 to internal clock, no prescale.
 Allow WDT to time out.

If WDT timeout :
 TMR0 should contain a fairly random value, at least in the lowest
few bits.

If you want more randomness, increase the WDT prescaler setting, to
measure a longer measurement period.
The TMR0 register may also have initialised randomly as well, which
will help.



On Tue, 14 Aug 2001 13:17:59 -0400, you wrote:

{Quote hidden}

should
>be determine by each individual chip.)
>
>Help?
>
>(By the way, I write my program in C and use PICC compiler.)
>
>Thanks in advance.
>
>Tony Pan

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\17@011848 by Vasile Surducan

flavicon
face
For up to 30 boards I'm sure you don't need a random start.
The answer is a daisy-chain connection, the n+1 board will start only
after then board n has start. The whole starting time could be under
5...30 seconds, but this depends on what you have on the boards.

Vasile

On Tue, 14 Aug 2001, Tony Pan wrote:

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\17@055833 by Peter L. Peres

picon face
You can implement a power-on delay based on the serial number of each
board (in firmware). Use it as a seed in a PRNG, then scale the output to
a time-span with increments large enough to allow for the surge to decay
before the next time-slot comes. The boards will come on spaced out in
that time interval. If the serial numbers are sequential (mine never are)
then you can just take that modulo N as a delay. This will give N sequence
'slots'.

Peter

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\17@060721 by Roman Black

flavicon
face
Olin Lathrop wrote:
>
> > My question is: how to generate a "truly" random number on the application
> > of power. The number should not be determined upon the compilation of the
> > software, but should be upon the initial powerup of the chip. (Or, it
> should
> > be determine by each individual chip.)
>
> Sounds like you DON'T want a random number, but rather a predetermined
> staggered startup delay.  With truly random numbers there is a finite
> probability that all boards will power up within some interval that will
> overload the power supply.

You could "daisy chain" all the modules using
one PIC pin on each module and two series
resistors, with a standard delay in each module
propagated down the chain.

Costs one PIC pin and two terminals per module.
And gives the higest level performance for
the task in question.
-Roman

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\17@061858 by Roman Black

flavicon
face
Tony Pan wrote:
>
> The possibility is there. That's why we want to have a good "random" number
> so that the starting time can be distributed as widely as possible within a
> certain window to reduce the possibility.
>
> There is no way we can stagger the starting time for the boards have no
> communications among themselves.

If the boards have access to the AC mains you could
set each board to a different part of the AC cycle,
either with dipswitches or hardwired as different
"model" boards. Or you could combinee the two systems,
part hardwired to the AC cycle, with some random
timing added. This would make it impossible for
ALL the boards to get the same random start time...
-Roman

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\17@062105 by Vasile Surducan

flavicon
face
On Fri, 17 Aug 2001, Roman Black wrote:

> Olin Lathrop wrote:
> >
> > > My question is: how to generate a "truly" random number on the application
> > > of power. The number should not be determined upon the compilation of the
> > > software, but should be upon the initial powerup of the chip. (Or, it
> > should
> > > be determine by each individual chip.)
> >
> > Sounds like you DON'T want a random number, but rather a predetermined
> > staggered startup delay.  With truly random numbers there is a finite
> > probability that all boards will power up within some interval that will
> > overload the power supply.
>
> You could "daisy chain" all the modules using
> one PIC pin on each module and two series
> resistors, with a standard delay in each module
> propagated down the chain.
>
 Roman, I know you like pics, but there is no need for any pic.
Everything depends how long take an "on" procedure on one board.
Is trivial to use a microcontroller when you could use safetly a capacitor
one or two resistors, and one transistor in worst case for any board...

Cheers, Vasile

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\17@104929 by John Waters

picon face
the "white noise" from the PN junction of a transistor is the source of a
truly random number. Software can never generate a truly random number.

>My question is: how to generate a "truly" random number on the application
>of power. The number should not be determined upon the compilation of the
>software, but should be upon the initial powerup of the chip. (Or, it
>should
>be determine by each individual chip.)


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\17@105955 by Spehro Pefhany

picon face
At 07:47 AM 8/17/01 -0700, you wrote:
>the "white noise" from the PN junction of a transistor is the source of a
>truly random number. Software can never generate a truly random number.

Usually these natural sources have to be hashed about a bit to generate
sequences that look reasonably random.

Best regards,
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
TakeThisOuTspeffEraseMEspamspam_OUTinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\18@031312 by Roman Black

flavicon
face
Vasile Surducan wrote:
>
> On Fri, 17 Aug 2001, Roman Black wrote:
>
> > Olin Lathrop wrote:
> > >
> > > > My question is: how to generate a "truly" random number on the application
> > > > of power. The number should not be determined upon the compilation of the
> > > > software, but should be upon the initial powerup of the chip. (Or, it
> > > should

> > You could "daisy chain" all the modules using
> > one PIC pin on each module and two series
> > resistors, with a standard delay in each module
> > propagated down the chain.
> >
>   Roman, I know you like pics, but there is no need for any pic.
> Everything depends how long take an "on" procedure on one board.
> Is trivial to use a microcontroller when you could use safetly a capacitor
> one or two resistors, and one transistor in worst case for any board...

Hi Vasile! Maybe I misunderstood, I thought
each module already had a PIC?? I was saying it
only really takes 1 PIC pin on each unit, and 2
terminals, so you can daisy chain them.
-Roman

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2001\08\20@194501 by Thomas McGahee

flavicon
face
You don't really need a random number generator to accomplish
what you want, which is to prevent all pics from coming
up at once. What you DO need is two free i/o lines per pic.
Let's call these line IN and OUT. The IN of the first PIC is
connected to Ground. The OUT of the first pic connects to the
IN of the second pic. The OUT of the second pic connects to
the IN of the third pic. Continue this procedure of connecting
the IN and OUT connections for each succeeding pic.

Note that the FIRST pic has it's IN line ALWAYS connected LOW
to Ground.

Now each pic has as part of its startup code the configuration
of it's IN and OUT i/o port bits. Then each pic outputs a
HIGH on its OUT i/o line. (use a pullup resistor if you are
the paranoid type and overly concerned about the fact that
the line will initially be an input and therefore floating).
Once the OUT line is configured, output a HIGH on this line.
Now finish up whatever other i/o initialization is required,
and then go into a loop waiting for IN to be LOW.

Since the FIRST pic has it's IN line hard-wired LOW, it will
be the first pic to meet this IN==LOW requirement. It will
then DELAY for the desired time (whatever time YOU have
programmed), and then it will put a LOW on it's OUT line.

This LOW now appears on the IN line of the NEXT pic, which
ALSO delays for some time and then makes *it's* OUT go
LOW, triggering the NEXT pic.

This process of delaying and then triggering the NEXT pic
continues until ALL pics have gone through the process.

If you want visual confirmation of each pic coming out of
it's WAIT mode, tie a 1k resistor to +5v and the other side
of the resistor to the anode of an LED. Connect the cathode
of the LED to the OUT line of the pic you want to monitor.
You can get more brightness if you use a lower value resistor,
but that increases current drain and raises the value of the
LOW output.

The method outlined above has the following good points:

 ALL pics are programmed exactly the same.
 The actual ORDER of turn-on is a function of the wiring order.
 It can be extended to handle any number of pics.
 Any pic can be used to trigger multiple "branches"

The bad point is:

 It uses two i/o lines per pic.

**************
Now, there IS a way to get by with only a single i/o line per
pic, but it *requires* a resistor and a regular RED LED per
pic. In this case each pic has a 1k resistor connected between
+5v and the single IN/OUT i/o pin. BETWEEN one pic and the
next there is a RED LED. The anode connects to the curent pic,
and the cathode of that LED connects to the PREVIOUS pic's
IN/OUT line. Except for the FIRST pic. The first pic's LED
has its cathode connected to Ground.

All pics start off with the IN/OUT line programmed as an INPUT.
That allows the first LED to have it's anode at about 1.5v,
and all the other LED anodes will be at AT LEAST +3v.
When a pic sees a LOW on its IN/OUT input, it delays,
then switches the IN/OUT pin to OUTPUT MODE, with the output
LOW. (Outputting a HIGH is a no-no, as this attempts to place
a full 5 volts across the LED).

As each pic outputs a LOW, the voltage on the NEXT pic's
IN/OUT (IN) line will drop to 1.5 volts. This is seen as a
change to the LOW state by the NEXT pic.

Visually, what you will see is only ONE LED on at a time.
As each pic finishes it's delay, the NEXT LED will
come on, and all previous LEDs will be off. Once the LAST
unit has undergone it's delay, ALL the LEDs will be OFF.

In place of an LED you can use two 1N4148 type diodes in series.
Possible cheaper, but you lose the visual indication.

By the way, different color LEDs have different "on" voltages,
and they range from about 1.2 to about 3 volts. Once you
find a brand and style of LED that works for you, stay with
that brand and style, as different LEDs of the same color
can have wide voltage variations. I have found most RED LEDs
to have about 1.5 volts across them at a few milliamps of
current flow.

Fr. Tom McGahee

----- Original Message -----
From: Tony Pan <weidong.panEraseMEspam.....VERIZON.NET>
To: <EraseMEPICLISTspamMITVMA.MIT.EDU>
Sent: Tuesday, August 14, 2001 1:42 PM
Subject: Re: [PIC]: Generating a "truly" random number on the application of
power


{Quote hidden}

of
{Quote hidden}

> > {Original Message removed}

2001\08\21@090824 by Douglas Butler

flavicon
face
I believe at the beginning of the thread it was mentioned that he
doesn't have any extra lines running between boards.

Sherpa Doug

> {Original Message removed}

2001\08\21@093053 by Tony Pan
picon face
Hi all,

Thank you so much for all the inputs and good suggestions!

Our products are used in motel environments to control ACs. The reason we
need to stagger the startup is that if we don't, in case of power loss and
resume, all the AC will start at the same time and that will cause a
problem. As you know each board is situated in its room and working
independently so there is no way one board knows what the other's doing.

After I read all the replies, I think I will try this:

In my hardware we use RC oscillator. Now I use the initial TMR0 value upon
powerup to get a random number. I also add the initial values of FSR, ADRES,
PORTB and some ADC reads of the board into the number. I guess that would
give me nearly "unique" number for each board. I then use the last few bits
of this number to determine the startup time.

I haven't got the chance to test it yet. For we have other features to
implement at the moment. If you see any potential problems with this
approach, please let me know.

Thanks alot!

Tony



----- Original Message -----
From: "Douglas Butler" <RemoveMEdbutlerTakeThisOuTspamspamIMETRIX.COM>
To: <EraseMEPICLISTspamspamspamBeGoneMITVMA.MIT.EDU>
Sent: Tuesday, August 21, 2001 8:58 AM
Subject: Re: [PIC]: Generating a "truly" random number on the application of
power


> I believe at the beginning of the thread it was mentioned that he
> doesn't have any extra lines running between boards.
>
> Sherpa Doug
>
> > {Original Message removed}

2001\08\21@102437 by Wollenberg, Frank

flavicon
face
Tony Pan wrote:

> Our products are used in motel environments to control ACs.
> The reason we
> need to stagger the startup is that if we don't, in case of
> power loss and
> resume, all the AC will start at the same time and that will cause a
> problem. As you know each board is situated in its room and working
> independently so there is no way one board knows what the
> other's doing.

AC will start on power-resume AND power-on..

> In my hardware we use RC oscillator. Now I use the initial
> TMR0 value upon
> powerup to get a random number. I also add the initial values
> of FSR, ADRES,
> PORTB and some ADC reads of the board into the number. I
> guess that would
> give me nearly "unique" number for each board. I then use the
> last few bits
> of this number to determine the startup time.

Using TMR0 is ok when using RC oscillator. Don't use TMR0 in crystal
operation.
FSR and ADRES are uninit on powerup, but i think they won't differ,
especially if the PIC's are from the same silizium.
PORTB must be input, but because of the identical hardware, the values
should be identical.
Reading a voltage divider with ADC is OK. Use carbon resistors (20%). Try to
not meet the acquisition time, the Chold is varying from chip to chip. Also
you can use an external reference voltage from a voltage divider (carbon!).

Compute this value ONLY on first powerup and use it as a initial seed value
of a random generator (hint: in C: persistent). Compute a random number as a
delay time after power becomes OK.

> I haven't got the chance to test it yet. For we have other features to
> implement at the moment. If you see any potential problems with this
> approach, please let me know.

It is possible to compute identical delay times, but the possibility is very
small.
Another approach is to use a "digital ID chip" from DALLAS (DS2401 i think).
This number IS unique !!!

Frank
--------------------------------------
GSP Sprachtechnologie GmbH
Frank Wollenberg
HW-Entwicklung
Tel.:   +49 (0)30 769929-78
Fax:    +49 (0)30 769929-12
eMail:  RemoveMEf.wollenbergKILLspamspamgsp-berlin.de


--
GSP Sprachtechnologie GmbH
Teltowkanalstr.1, D-12247 Berlin
Tel.:  +49 (0)30 769929-0
Fax:   +49 (0)30 769929-12
eMail: InfoSTOPspamspamspam_OUTgsp-berlin.de
Web:   http://www.gsp-berlin.de

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\21@105157 by Tony Pan

picon face
Thanks Frank.

>>>> Using TMR0 is ok when using RC oscillator. Don't use TMR0 in crystal
operation.

Why?

In addition, some advised me to let the WDT time-out for the first time
after power then get the TMR0. When I think about it, since the TMR0 is
un-initialized upon powerup, is it really necessary to go through the WDT
time-out?

Tony

{Original Message removed}

2001\08\21@110549 by Douglas Butler

flavicon
face
"Un-initialized" does not mean random.  It means the value is not
defined by the spec.  The value may be consistent for a production lot
of chips though.  Racing your own RC osc against the watchdog's RC
should produce a good random number.

Sherpa Doug

> {Original Message removed}

2001\08\21@110829 by Don Hyde

flavicon
face
If you want your boards to have a random dispersion due to component
variation, 20% resistors might not be the best choice.

Resistors are often offered in different precision grades, which is achieved
by selecting the closest-tolerance parts from a production run.  The ones
that make 1% or 5% go into the higher-priced bin, and the rest go into the
cheap bin.

The bunch in the cheap bin are unlikely to have a normal distribution about
the center value.  If the process is well-tuned and the ones coming off the
line have a nice distribution about the target value, then the cheapie parts
will have a hole in the distribution where the good ones were taken out.
They may all be within 20%, but NONE will be within 5%!

Getting your random variation from a part like a cap that isn't sold in
varying precision grades might give a more dependably random distribution of
times.

Maybe you could buy good resistors of varying values and mix your own random
selection by dumping them in a barrel and shaking them up.

> {Original Message removed}

2001\08\21@113631 by Tony Pan

picon face
Now I understand.

----- Original Message -----
From: "Douglas Butler" <spamBeGonedbutlerSTOPspamspamEraseMEIMETRIX.COM>
To: <KILLspamPICLISTspamBeGonespamMITVMA.MIT.EDU>
Sent: Tuesday, August 21, 2001 10:54 AM
Subject: Re: [PIC]: Generating a "truly" random number on the application of
power


> "Un-initialized" does not mean random.  It means the value is not
> defined by the spec.  The value may be consistent for a production lot
> of chips though.  Racing your own RC osc against the watchdog's RC
> should produce a good random number.
>
> Sherpa Doug
>
> > {Original Message removed}

2001\08\21@115047 by Tony Pan

picon face
Good point. But buying good resistors of varying values and mixing them up
is not very practical in production. They use reel components.

I will use a simply algorithm to distribute the random number. I shift the
number so that the lest-significant bit becomes the most significant and the
most becomes the lest. This way the number will be distributed fairly even.
For example, two numbers 42 (0b00101010) and 43 (0b00101011) are next to
each other; but after I shift them, they will become 84 (0b01010100) and 212
(0b11010100) -- broadly separated. So I am not too worry about the
distribution of the random number. As long as they are unique each board /
each time, I can distribute it myself.

Tony

----- Original Message -----
From: "Don Hyde" <EraseMEDonHspamEraseMEAXONN.COM>
To: <@spam@PICLIST@spam@spamspam_OUTMITVMA.MIT.EDU>
Sent: Tuesday, August 21, 2001 11:06 AM
Subject: Re: [PIC]: Generating a "truly" random number on the application of
power


> If you want your boards to have a random dispersion due to component
> variation, 20% resistors might not be the best choice.
>
> Resistors are often offered in different precision grades, which is
achieved
> by selecting the closest-tolerance parts from a production run.  The ones
> that make 1% or 5% go into the higher-priced bin, and the rest go into the
> cheap bin.
>
> The bunch in the cheap bin are unlikely to have a normal distribution
about
> the center value.  If the process is well-tuned and the ones coming off
the
> line have a nice distribution about the target value, then the cheapie
parts
> will have a hole in the distribution where the good ones were taken out.
> They may all be within 20%, but NONE will be within 5%!
>
> Getting your random variation from a part like a cap that isn't sold in
> varying precision grades might give a more dependably random distribution
of
> times.
>
> Maybe you could buy good resistors of varying values and mix your own
random
> selection by dumping them in a barrel and shaking them up.
>
> > {Original Message removed}

2001\08\21@132122 by mike

flavicon
face
On Tue, 21 Aug 2001 10:50:45 -0400, you wrote:

>Thanks Frank.
>
>>>>> Using TMR0 is ok when using RC oscillator. Don't use TMR0 in crystal
>operation.
>
>Why?
>
>In addition, some advised me to let the WDT time-out for the first time
>after power then get the TMR0. When I think about it, since the TMR0 is
>un-initialized upon powerup, is it really necessary to go through the WDT
>time-out?
Although TMR0's startup state is undefined, you may find that a batch
of chips could all come up with the same or similar values - using the
WDT's RC osc period should guarantee more variation between parts, as
other variables such as supply voltage (regulator tolerance) and
temperature will help shake things up. It's trivial to do, and will
undoubtably give a more intederminite result. Remember we are not
strictly after randomness, but a characteristic that is strongly
dependent on chip-to-chip variations. It doesn't matter if a chip
comes up with the same value every time, as long as this value stands
a good chance of being different from its neighbours.
--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\22@050417 by Wollenberg, Frank

flavicon
face
>> Using TMR0 is ok when using RC oscillator. Don't use
>> TMR0 in crystal operation.
>
> Why?
>
Sorry, i was wrong. Have thought to timer 1 in external clock mode using a
RC.

> In addition, some advised me to let the WDT time-out for the first time
> after power then get the TMR0. When I think about it, since the TMR0 is
> un-initialized upon powerup, is it really necessary to go through the WDT
> time-out?
>
Good idea. The WDT timeout will varying on internal cap varyfication,
voltage supply and others.
Should be no or minor problem to implement this.

Frank
---------------------------
GSP Sprachtechnologie GmbH
Frank Wollenberg
HW-Entwicklung
Tel.:   +49 (0)30 769929-78
Fax:    +49 (0)30 769929-12
eMail:  spamBeGonef.wollenbergspamKILLspamgsp-berlin.de


--
GSP Sprachtechnologie GmbH
Teltowkanalstr.1, D-12247 Berlin
Tel.:  +49 (0)30 769929-0
Fax:   +49 (0)30 769929-12
eMail: .....Infospam_OUTspamgsp-berlin.de
Web:   http://www.gsp-berlin.de

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\22@051936 by Wollenberg, Frank

flavicon
face
Tony Pan [TakeThisOuTweidong.pan.....spamTakeThisOuTVERIZON.NET] wrote:
> I will use a simply algorithm to distribute the random number. I shift the
> number so that the lest-significant bit becomes the most significant and
the
> most becomes the lest. This way the number will be distributed fairly
even.
> For example, two numbers 42 (0b00101010) and 43 (0b00101011) are next to
> each other; but after I shift them, they will become 84 (0b01010100) and
212
> (0b11010100) -- broadly separated. So I am not too worry about the
> distribution of the random number. As long as they are unique each board /
> each time, I can distribute it myself.
>
Seems for me ok. But it's only a translation, value for value. You will only
change the distribution over the entire area.

Frank
--------------------------
GSP Sprachtechnologie GmbH
Frank Wollenberg
HW-Entwicklung
Tel.:   +49 (0)30 769929-78
Fax:    +49 (0)30 769929-12
eMail:  TakeThisOuTf.wollenbergKILLspamspamspamgsp-berlin.de


--
GSP Sprachtechnologie GmbH
Teltowkanalstr.1, D-12247 Berlin
Tel.:  +49 (0)30 769929-0
Fax:   +49 (0)30 769929-12
eMail: .....InfospamRemoveMEgsp-berlin.de
Web:   http://www.gsp-berlin.de

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\22@055046 by Wollenberg, Frank

flavicon
face
Mike Maiorana [RemoveMEmikemospamspamBeGoneATTGLOBAL.NET] wrote:

> Perhaps you could put a low frequency oscillator on each board, triangle
> wave at let's say 20 Hz. The oscillators can be analog, free running and
> start when power is applied to the board. When the micro comes up,
> sample the instantaneous voltage with one of the a/d channels (assuming
> you have one). The tolerance in the oscillator parts should give enough
> randomness to the frequencies that your initial reading numbers should
> be quite random.

Using RC-OSC, TMR0 and WDT all together as described previously is much
easier.
If Crystal-OSC is needed, one can use TMR1 in external clock mode using a
RC.

Frank
--------------------------
GSP Sprachtechnologie GmbH
Frank Wollenberg
HW-Entwicklung
Tel.:   +49 (0)30 769929-78
Fax:    +49 (0)30 769929-12
eMail:  spamBeGonef.wollenberg@spam@spamspam_OUTgsp-berlin.de



--
GSP Sprachtechnologie GmbH
Teltowkanalstr.1, D-12247 Berlin
Tel.:  +49 (0)30 769929-0
Fax:   +49 (0)30 769929-12
eMail: TakeThisOuTInfospamspamgsp-berlin.de
Web:   http://www.gsp-berlin.de

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...