> Anybody know how to generate a random number with a pic? A finite state machine can't generate truly random numbers. To do that requires some external input. However, it can generate pseudo random numbers that are usually good enough. See the HAL_RAND.ASPIC module of my HAL project at http://www.embedinc.com/pic/hal.htm. Its pseudo random sequence is good enough for most purposes. It uses timer 0, so becomes more random if program timing is in some way related to external events. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu