I'd probably add a software counter to your existing timer1 routine so that every so many timer1 interrupt calls something happens. You can then put random numbers in youyr "ram timers" during the reload. Actually generating random numbers seems a bit more difficult. I tried doing stuff that I thought would be random based on apparently independent timing loops, but they always ended up synching up with each other giving a nonrandom pattern. I finally wrote a little C program to generate a table of 256 random numbers between 0 and 255, then put these in a PIC lookup table. Looked pretty random. Harold On Sun, 4 Jan 1998 17:26:42 -0500 Tom Sgouros writes: >Does anyone have any clever ways to generate essentially random long >intervals (between 1 and 30 minutes). I am already using Timer1 and >the PWM module on a PIC16c65, but I think there is a lot of computing >power and peripheral capacity left over. > >-tom > >---------------------------------------------------------------------- >tomss at ids.net - 401-861-2831 - 42 Forge Rd, Potowomut, RI 02818 USA >