I did some research on this for my Computer Organization course, where for a project my students work on simple games using PICs. The best resource I found is the ORB: http://home.comcast.net/~orb/index.html You can get some great ideas from the details page: http://home.comcast.net/~orb/details.html BAJ On Fri, Oct 28, 2011 at 01:31:48AM -0600, Forrest Christian wrote: > For an open house/demo for our new Pick and Place, we're using up some=20 > PIC18f26J11's and PIC18f26K22's, both in the (same) wrong package, to=20 > make a pair of 'digital dice'. Basically 14 LED's arranged into the=20 > pattern of two dice, appropriate current limiting resistors, attached to= =20 > high-current output PIC pins, and a pair of AA's to power the whole=20 > thing, along with a pushbutton hooked to MCLR to re-roll the dice. >=20 > Simple algorithm: Wake up, generate a random number, display on dice=20 > (probably with some simulated rolling), and then wait 30 or so seconds,=20 > then drop into SLEEP mode, or deep sleep if supported on that processor. >=20 > Problem being: I really want to use MCLR to reset this so I can use=20 > deep sleep. AND... because I'm starting from the same state every time= =20 > the unit wakes up, I need an entropy source to seed a random number=20 > generator. >=20 > My initial thought is to just sample the LSB of a hundred or so ADC=20 > conversions from an unconnected ADC input, or maybe count the clock=20 > ticks in a few cycles of the internal 32K RC oscillator. or something=20 > like that. All seem workable, and I'll try a few of them... but was=20 > also hopeful that someone on the list had had to do something similar=20 > and knew what would or wouldn't work so I didn't have to reinvent the=20 > wheel in this case. >=20 > Mainly I need enough bits to get a reasonably random distribution for a=20 > number between 1 and 32 (I.E I need 5 'good' random bits, which are=20 > fairly random. Of course, more is better). >=20 > -forrest > --=20 > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 Byron A. Jeff Department Chair: IT/CS/CNET College of Information and Mathematical Sciences Clayton State University http://cims.clayton.edu/bjeff --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .