Hi! I need to generate three bytes of pseudo-random numbers for
an app. I'm working on that features PIC12C508 and 509.
Then I need to count the number of ones present on those 24 bits.
Any cool ideas on solving any of these tasks are welcome!
On Mon, Aug 30, 1999 at 09:13:34PM +0000, German wrote:
> Hi! I need to generate three bytes of pseudo-random numbers for
> an app. I'm working on that features PIC12C508 and 509.
> Then I need to count the number of ones present on those 24 bits.
> Any cool ideas on solving any of these tasks are welcome!
http://quozl.us.netrek.org/ has a random LED flasher on 12C509 that has
code you may be able to use. 24 bit psuedo-random number generator.
exactly yesterday I have finished my hardware true (not pseudo) random
number generator. It outputs a random bit sequence in CMOS logic. If
interested, I can post the schematic (in ASCII, one page). I guess, you
should connect the output to the T0CKI, and sample it - say - in every 1
msec.
> Hi! I need to generate three bytes of pseudo-random numbers for
> an app. I'm working on that features PIC12C508 and 509.
> Then I need to count the number of ones present on those 24 bits.
> Any cool ideas on solving any of these tasks are welcome!
>
> Thanks a lot!
> ------------------------------------
> netQ <netquakeKILLspaminnocent.com>
> http://virtuaweb.com/picprog
> "Home of amateur PIC programmers..."
>
> -----BEGIN PGP PUBLIC KEY BLOCK-----
> Version: 2.6.2
>
> mQCNAzV38BkAAAEEALfWv9j3f+tZ+z2IW+2o9Ebx4bUGnHjHPqIe0a6yVKawaeV/
> Y4I6L2/A0ddbVMG8+qJ0MvHNkr3DzYkpW+hTl9zAzXkKBdZ3GA5bbvot7entl/O2
> YDtRWUV730koxBo5iFFUbJH5kbmkox+h3znj34zPnZNWzNaqOAwol3wABfBNAAUT
> tBxOZXRRIDxuZXRxdWFrZUBpbm5vY2VudC5jb20+
> =0bVU
> -----END PGP PUBLIC KEY BLOCK-----
>
>
>
> Hello,
>
> exactly yesterday I have finished my hardware true (not pseudo) random
> number generator. It outputs a random bit sequence in CMOS logic. If
> interested, I can post the schematic (in ASCII, one page). I guess, you
> should connect the output to the T0CKI, and sample it - say - in every 1
> msec.
>
> Regards,
> Imre
>
> On Mon, 30 Aug 1999, German wrote:
>
> > Hi! I need to generate three bytes of pseudo-random numbers for
> > an app. I'm working on that features PIC12C508 and 509.
> > Then I need to count the number of ones present on those 24 bits.
> > Any cool ideas on solving any of these tasks are welcome!
> >
> > Thanks a lot!
> > ------------------------------------
> > netQ <.....netquakeKILLspam.....innocent.com>
> > http://virtuaweb.com/picprog
> > "Home of amateur PIC programmers..."
> >
> > -----BEGIN PGP PUBLIC KEY BLOCK-----
> > Version: 2.6.2
> >
> > mQCNAzV38BkAAAEEALfWv9j3f+tZ+z2IW+2o9Ebx4bUGnHjHPqIe0a6yVKawaeV/
> > Y4I6L2/A0ddbVMG8+qJ0MvHNkr3DzYkpW+hTl9zAzXkKBdZ3GA5bbvot7entl/O2
> > YDtRWUV730koxBo5iFFUbJH5kbmkox+h3znj34zPnZNWzNaqOAwol3wABfBNAAUT
> > tBxOZXRRIDxuZXRxdWFrZUBpbm5vY2VudC5jb20+
> > =0bVU
> > -----END PGP PUBLIC KEY BLOCK-----
> >
> >
At 10:09 AM 8/31/99 +0200, Imre wrote:
>exactly yesterday I have finished my hardware true (not pseudo) random
>number generator. It outputs a random bit sequence in CMOS logic. If
>interested, I can post the schematic (in ASCII, one page). I guess, you
>should connect the output to the T0CKI, and sample it - say - in every 1
>msec.
I for one would be interested. Have you done a power spectrum analysis to
see how 'true' you hardware is at generating 'white' noise?
================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: EraseMEralspam_OUTTakeThisOuTlcfltd.com
Least Cost Formulations, Ltd. URL: http://lcfltd.com/
824 Timberlake Drive Tel: 757-467-0954
Virginia Beach, VA 23464-3239 Fax: 757-467-2947
"Vere scire est per causae scire"
================================================================
>
> Hello,
>
> exactly yesterday I have finished my hardware true (not pseudo) random
> number generator. It outputs a random bit sequence in CMOS logic. If
> interested, I can post the schematic (in ASCII, one page). I guess, you
> should connect the output to the T0CKI, and sample it - say - in every 1
> msec.
>
> Regards,
> Imre
Hi! I need to generate three bytes of pseudo-random numbers for
an app. I'm working on that features PIC12C508 and 509.
Then I need to count the number of ones present on those 24 bits.
Any cool ideas on solving any of these tasks are welcome!
--- Bob Wake & Renie McMeeken <spamBeGonerwakespamBeGonePATHCOM.COM> wrote:
> >
> > Hello,
> >
> > exactly yesterday I have finished my hardware true (not pseudo) random
> > number generator. It outputs a random bit sequence in CMOS logic. If
> > interested, I can post the schematic (in ASCII, one page). I guess, you
> > should connect the output to the T0CKI, and sample it - say - in every 1
> > msec.
> >
> > Regards,
> > Imre
>
> Post That Puppy!
>
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
> At 10:09 AM 8/31/99 +0200, Imre wrote:
> >exactly yesterday I have finished my hardware true (not pseudo) random
> >number generator. It outputs a random bit sequence in CMOS logic. If
> >interested, I can post the schematic (in ASCII, one page). I guess, you
> >should connect the output to the T0CKI, and sample it - say - in every 1
> >msec.
>
> I for one would be interested. Have you done a power spectrum analysis to
> see how 'true' you hardware is at generating 'white' noise?
>
>
> ================================================================
> Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: TakeThisOuTralEraseMEspam_OUTlcfltd.com
> Least Cost Formulations, Ltd. URL: http://lcfltd.com/
> 824 Timberlake Drive Tel: 757-467-0954
> Virginia Beach, VA 23464-3239 Fax: 757-467-2947
>
> "Vere scire est per causae scire"
> ================================================================
>
>
Where does the transistor collector go? Presumably to Vdd? (Unconnected as
shown.)
================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: RemoveMEralTakeThisOuTlcfltd.com
Least Cost Formulations, Ltd. URL: http://lcfltd.com/
824 Timberlake Drive Tel: 757-467-0954
Virginia Beach, VA 23464-3239 Fax: 757-467-2947
"Vere scire est per causae scire"
================================================================
> Where does the transistor collector go? Presumably to Vdd? (Unconnected as
> shown.)
>
The collector is not connected. This circuit relies on the reverse
breakdown of the Base-Emitter junction which produces a lot of noise. More
or less the same as a zener diode, which can also be very noisy, although a
transistor is usually worse (or better depending on your point of view).
Hej Michael Rigby-Jones. Tack fšr ditt meddelande 11:24 1999-09-01 +0100 enligt nedan: {Quote hidden}
> > At 09:13 AM 9/1/99 +0200, Imre wrote:
> > > White noise generator, design by dr. Imre Bartfai, 8/30/1999
> > >
> > > +---------------------------------------------------------------------
> > Vdd
> > > | 220k 220k
> > 5V
> > > | +---\/\/\---+ +---\/\/\---+------+
> > > | | | | | |
> > > | Ge | |\ | | +------+ \
> > > | EFT317 PNP +-----+----|- \ | | | /
> > 220k
> > > | C | | | >-+----| |----+ | |\ \
> > > | |/ \ +-------|+ / 47n | +-----|- \ |
> > > +--B| 220k / | | |/ | | | >--+
> > > |\ \ | | 1/2 LM358 +----------|+ / |
> > > |E | | | | | |/ \
> > > +----| |----+--+ + + + /
> > 47k
> > > | 47n | | | | 1/2 LM358 \
> > > \ \ \ \ \ |
> > > 4k7 / 1M / / 2k2 1M / / 2k2 + out
> > > \ \ \ \ \
> > > | | | | |
> > > +-----------+-----+-----------------------+----+----------------
> > Vss
> >
> Robert A. LaBudde wrote:
>
> > Where does the transistor collector go? Presumably to Vdd? (Unconnected as
> > shown.)
> >
>The collector is not connected. This circuit relies on the reverse
>breakdown of the Base-Emitter junction which produces a lot of noise. More
>or less the same as a zener diode, which can also be very noisy, although a
>transistor is usually worse (or better depending on your point of view).
>
>Regards
>
>Mike Rigby-Jones
Suggestion, untested:
I would think that connecting a cap between B and Vss would increase the noise output. (making a "stamp-off" pointfor the transistor noise voltage with much lower impedance than only the 220k resistor)
The idea is to in next step reduce the amplifier to just one opamp stage.
Regards
/Morgan
Morgans Reglerteknik, HŠllekŒs, 277 35 KIVIK, SWEDEN
tel +46(0)414-446620, fax -70331, mrtEraseME.....iname.com
For most transistors it takes around 7 volts to break down the reverse
emitter/base junction so this circuit may not work at 5 volts. Maybe you
can substitute a low voltage zener for the transistor.
Maris
>For most transistors it takes around 7 volts to break down the reverse
>emitter/base junction so this circuit may not work at 5 volts. Maybe you
>can substitute a low voltage zener for the transistor.
>Maris
>
>
>At 09:13 AM 9/1/99 +0200, you wrote:
>>Hi,
>>as more people wished, here is the true h/w random number generator:
>>
>> White noise generator, design by dr. Imre Bartfai, 8/30/1999
>>
>> +---------------------------------------------------------------------
Vss
>>
>> Standard TTL can not be driven, but CMOS (and maybe LS) are o.k.
>> The power supply must be filtered thoroughly due to the high gain!
>>
>>Regards,
>>Imre
>>
>>
This circuit relies on the breakdown of the transistor junction to make
"white noise".
While 5V may work for the device specified many transistors need more than
this to function in this manner - if your version of this cct doesn't work
consider this as a possible cause - you may need 9v or possibly even as
much 12.
Russell McMahon
>as more people wished, here is the true h/w random number generator:
>
> White noise generator, design by dr. Imre Bartfai, 8/30/1999
part 0 5903 bytes content-type:application/x-unknown-content-type-PFE32; name=noise509.asm (decoded 7bit)
Nino
Code follows...
;
; Pseudorandom digital white noise generator for PIC series.
;
; PIC12C508 version written April 7th, 1997 by Scott Rider.
; Questions/comment to RemoveMEchipTakeThisOuTspamaeug.org
;
; PIC12C509 modified version by Antonio L. Benci. 22/03/1999.
;
; This program uses Microchip assembler mnemonics and the Microchip
; MPASM assembler (http://www.microchip.com/). Default config options
; are set in the __FUSES line below: MCLRE off, CP off, WDT off,
OSC=INTRC.
;
; _______ _______
; | \/ |
; (+5V) Vdd --+ 1 8 +-- Vss (GND)
; | | 470
; X1/CLKI/GP5 --+ 2 7 +-- GP0 (audio out) --/\/\/-- (spkr)
; (not used) | | | 10K 1uF
; X2/CLKO/GP4 --+ 3 6 +-- GP1 --/\/\/--|(--
(line)
; (swt input) | | (swt input)
; GP3/!MCLR --+ 4 5 +-- GP2
; (swt input) | (PIC12C508) | (swt input)
; +----------------+
;
; This program generates a continuous stream of white noise through a
; speaker connected (via a 470-ohm series resistor) to pin GP0 of a
; PIC12C509. It demonstrates an easy method for generating a seemingly
; random stream of bits. Hardware folks will probably recognize it as
the
; tapped shift register technique covered in the CMOS Cookbook by Don
; Lancaster.
;
; Adapted from the original PIC16C54 (Parallax) version by Scott
Edwards.
;
;##########################################################################
;
; Programmable noise weighting added by A L Benci 22/03/1999
;
; GP1..GP4 are connected to a dip switch which the user can use to
select
; 'textures' of 2 to 30. A zero value skips the function.
;
;
list p=12c509
radix dec
include "p12c509.inc"
cblock 0x07 ;Variables
i ;Loop counter
x ;Scratch
y ;Scratch
zz ;Scratch
sr0 ;32 bits of shift register
sr1
sr2
sr3 ;/
endc
org 0x0
;
; PIC12C509 cold starts at 03FFF (where it loads a factory-programmed
; internal osc. calibrate value). It then rolls over to 0x0.
;
movwf OSCCAL
goto start
;
; Subroutines in 12-bit PIC series must go on bottom page of ROM.
;
wait
loop decfsz i,F
goto loop
retlw 0
;
; Main code area traditionally starts at 0x100 on a 12-bit PIC.
;
org 0x100
start movlw b'11000000' ;Turn off T0CKI
option ;/
movlw b'00000000' ;Preset outputs to come up low
movwf GPIO ;/
movlw b'00011110' ;Set the I/O direction (GP3..GP1 as inputs,
GP0,GP5 as output)
tris GPIO
clrf sr0 ;Might as well start with a seed of zero.
clrf sr1
clrf sr2
clrf sr3 ;/
;
; The main loop 'taps' is 24 CPU cycles. At the 4MHz internal clock
; rate, the noise output is operating at a max. rate of about 21KHz.
;
taps btfss sr3,6 ;Get bits 18 and 31 for the feedback
XOR.
bcf x,0
btfsc sr3,6
bsf x,0 ;Bit 31 -> x
rlf sr0,F ;32-bit shift
rlf sr1,F
rlf sr2,F
rlf sr3,F ;/
;
; Put a pseudorandom bit out to the speaker. In this example, GPIO bit
0
; (pin 7 on the PIC12C509) is used. Be sure to use a 470 ohm resistor
for
; speaker or 10K or better for input to an op-amp/divider/whatever.
;
Content-type: text/x-vcard; name=Nino.Benci.vcf; charset=us-ascii
Content-description: Card for Antonio L Benci
Content-disposition: attachment; filename=Nino.Benci.vcf
Content-transfer-encoding: 7BIT
Hi,
note, that the transistor is an obsolete Ge-PNP dug out of the junk box.
The Zener provided far worse results. This, however, worked at 5 volts
definitely.
At 05:42 PM 09/01/1999 +1000, you wrote:
>My previous reply included the code example in line and as an
>attachement. This was an error on my part. Appologies if this causes
>problems, i was too fast on the SEND button...
Thanks for sharing it. Personally, I like including the code in the body of
the message when it's small enough. Makes it much easier to archive for future
reference (otherwise, we have to imbed it in the message ourselves). Fact is,
most people saving your info won't be using your code exactly as you wrote
it,
anyway; we'll be modifying it to suit our own needs. Since we'll be editing
the file anyway, it's simple to also strip off the message portions of a
combined file.
So, as long as it doesn't cause any unobvious problems with the list, I'm all
for sending a single text message, instead of attatching text to text. Save
the
attatchments for binaries.
Thanks again for sharing your work & take care...
Wes B.
************************************************************************
* Wes B. * "It's a wonderful world out there, Hobbes old *
* EraseMEwesbEraseMEpronetisp.net * buddy... Let's go exploring." - Calvin *
************************************************************************