Chen Xiao Fan wrote: >I used the suggestion to generate 1-8 (and with 0x07) >and 1-64 (0x3F) but somehow it loses quite some randomness. >I will check the code again. > > 1. Were you using a shift register method, they generate one random bit per cycle, so you would need to do several cycles. 2. Make sure you kept the random number generated, and did not use the modified number in the next cycle. David -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist