Rob Stockley wrote: > PIC: 16f648a with 20MHz xtal > > Assuming no prescaling does one tick occur for every cycle? > > t(s) = 1 / xtal Almost. The first thing that the PIC does with the 20 MHz clock is divide it by 4... So with a 20 MHz clock, each timer tick (and each instruction cycle) is: t(s) = 1 / (xtal/4) = 1 / 5 MHz = 200 nanoseconds > So with prescaler 1:8... > > t(s) = ( 8 / 20 * 10^6 ) = 0.4us Same thing; you need to divide the clock speed by 4: t(s) = 8 / 5 MHz = 1.6 uS -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads