I have made a "random" routine for a CSMA/CD network in a 16C84. I used bit0-3 from TMR0, it gave me a 16 step "random" number. With 208 uSec delay pr. step, it gave a delay from the last collision, between 0 and 3.12 mSec. (to that, I added 5 mSec). It works very well, due to the fact, that all the 4 MHz x-tal on the network, are not synchronized. mvh Arne Hedevang Denmark > I need a routine that returns a random number to implement something similar > to CSDMA/CD. I need it to make a random wait time after a collision, i've > seem some routines but how do i get different seeds to inicialize the > routine ? Hmm... depending upon the number of nodes in your system and how they're powered you /may/ have a problem. While using a timer to seed your RNG is a nice concept, it won't do much good if several PICs happened to choose the same seed (as would be quite possible if all the machines were powered on simultaneously). If the seeds happen to match, it doesn't matter how many times you cycle the RNG; all the "random" numbers are going to match as well. In many network topologies, a node's address is used to seed the random-delay routine (or else simply sets a fixed delay duration). Would such an approach be feasible for you? If every node has a unique address, that would provide a good way of producing the "random" delays without the "bad" cases you could get with a timer-seeded RNG.