----- Original Message ----- From: "4e fte" <4eftefj@gmail.com> To: "Microcontroller discussion list - Public." Sent: Tuesday, January 20, 2009 3:51 PM Subject: [PIC] 1s delay with 20MHz 16F84A >I have seen some examples of 1s delay with a 32KHz or 4MHz frequencies > but am still confused about how to produce this with 20MHz. Could > someone please assist me on this? Thanks. > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > How were those delays implemented: nested loops, external timer interrupt, internal timer??? You say you have seen the examples, but you don't say if you understood them. Assuming nested loops and that you understand instruction cycle time (1/4 clock cycle time) and know how many cycles each instruction takes (see datasheet), just increase the number of counts, adding loops as necessary, to arrive at five times the number of counts used to achieve a 1s delay at 4 MHz. For a 20 MHz clock, you'll need 5,000,000 cycles to create a 1s delay. If you can be more specific about what part of the delay code is causing you problems, someone here will be better able to explain this. Good luck. Richard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist