> The 555 is for giving 60Hz without any complicated divisors. I > had thought of doing it in software, but I chose to go the other way. To get an "exact but average" 60Hz with a 20MHz isn't too difficult but there are easier ways 60Hz = 83333(recurring)us period = (83333+83333+83334)/3, which could be done using a cycle of 3 timing loops However, if you change to a hex value crystal something close to your 20MHz (18.432MHz or 19.6608MHz) it becomes quite simple (18432000/4) / 256 = 18000 TMR0 IRQs / sec = 150 per 1/2 cycle Similarly 19.6608 -> 160 IRQs / 1/2 cycle Allow TMR0 to free-run and have an interrupt to bump a RAM counter -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads