-----Original Message-----
From: D Lloyd [SMTP:dan.lloyd@GB.ABB.COM]
Sent: Tuesday, April 18, 2000 9:02 AM
To: PICLIST@MITVMA.MIT.EDU
Subject: Re: [OT] Software Random function
Marc <marc@AARGH.FRANKEN.DE>
17/04/2000 17:51
Please respond to pic microcontroller discussion list <PICLIST@MITVMA.MIT.EDU>
To: PICLIST@MITVMA.MIT.EDU
cc: (bcc: Dan Lloyd/GBPTD/ABB)
Subject: Re: [OT] Software Random function
Security Level:? Internal
> LFSR: RLF RANDOM,W
> RLF RANDOM,W
> BTFSC RANDOM,4
> XORLW 1
> BTFSC RANDOM,5
> XORLW 1
> BTFSC RANDOM,3
> XORLW 1
> MOVWF RANDOM
> RETLW 0
Pretty predictable (short-term), isn't it?
* That's what I was thinkning. I imagine you have to be pretty careful how you
use this.
Dan
It's utterly predicatble. It is after all, a PSEUDO random number generator. It produces a repeating pattern of a very limited length. Not sure if its 127 or 255 for this arrangement. You could use a 24 bit (or more) register to get longer patterns though, using the same principle. The Art of Electronics has a good section on maximal length PRBS generators.
Mike