How did you get to 12.5x10-6 seconds? John Dammeyer Wireless CAN with the CANRF module now available. http://www.autoartisans.com/products Automation Artisans Inc. Ph. 1 250 544 4950 > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Russell C. Hay > Sent: Thursday, March 13, 2003 2:03 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC] question about timing.. > > > 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 > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads