On Thu, 13 Mar 2003 14:02:45 -0800, you wrote: >I just want to make sure that I'm thinking about this correctly. Please >correct me if I'm wrong in this. > >So assuming a 20Mhz PIC (in this case, it's going to be a 16f876), that >means we have 20x10^6 clock cycles per second (duh, right?). Each >instruction cycle is 4 clock cycles, so now we have 5x10^6 instructions = per >second, which is basically 12.5x10-6 seconds (12.5 nanoseconds) per >instruction. So, to get a 1 microsecond delay, I'd need 80 instruction >cycles, which in turn means that I'd need 80,000 instruction cycles to = get a >1 milisecond delay. Is this right? >I think my logic (and math) is sound, but since the number is so big, I = just >want to ask someone who knows a bit more than me if I'm correct. > >-R No - your maths are wrong.=20 at 20MHz, you do 5M instructions/sec, 200ns per instruction, 5 = instruction times per microsecond, 5000 instruction times per millisecond -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads