----- Original Message ----- From: johm To: Sent: Friday, December 15, 2000 2:57 AM Subject: Re: [PIC]: Random numbers with a 16f84/16f877? > Perhaps you can mix the use of a timer ( only one on 16f84 ) and the program > counter ( if your code is big enough and the number to generate is create on > IT). > > The solution I propose is to make a loop in your main program that generate > at least 256 word of code ( example "nop") and to let the timer0 to run. If > you generate your number with the interrupt code, you juste need to read the > PCL and the TMR0 and to make a exclusive OR or something like that. > You just need the put a prescaler /= 1 and the value of the timer will run > at a different speed than the program counter. > I've never tested this solution, but i hope it will help you and it will > generate something like a random number. > > Guillaume This will _not_ work well because the timer is syncronized to the system clock. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.