> I=B9m doing led dies As someone else suggested a fast-running clock will give you random output on the dice. I've seen a couple of electronic dice projects in magazines that do it this way. The dice are driven 1 - 6 at high speed (no micro, just an oscillator) and it's purely chance what number is showing when you push a button However, you did also ask about external input. I've had to do this very recently to generate large random numbers and used white noise http://home.clear.net.nz/pages/joecolquitt/white_noise.html This little snippet of code may not make a lot of sense out of contex= t but what it basically does is to read the timer low byte after a rand= om delay (caused by noise transitions on a port pin). The timer low byte read after this delay then becomes the random number used in the rest of the code. It appears so far to produce unpredictable randomne= ss I'm pretty sure you don't need to go to these lengths as you're deali= ng with a restricted range of numbers ;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D rndlo call noise movf tmr1l,w ;get timer low byte after random dela= y movwf lo btfss high_eqlm ;test addlow if hi=3Dcnt2 goto rnd_th ;else keep it movlw 0x01 ;comparison for range limit addwf cnt1,w subwf lo,w btfsc carry goto rndlo ;re-generate until lo < cnt1+1 =2E...... rest of code ;----------- noise movf tmr1l,w ;loop anywhere from 0x08 to 0x17 times andlw 0x0f addlw 0x08 movwf index t_rnd btfss noise ;count noise L > H > L transitions goto $-1 nop btfsc noise goto $-1 decfsz index,f goto t_rnd return -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.