From piclist.com: http://www.piclist.com/techref/microchip/rand8bit.htm I used: 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 (Andrew Warren) For extra confusion, TMR0 ran in the background with no prescaller. Every time TMR0 interupted, I ran the above code and loaded RANDOM into TMR0. When ever I needed a Random number, I load the value from TMR0. You don't need to use TMR0 or interupt, it was free in this application so I used it. Quentin -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads