[time-nuts] A Simple PIC Divider

Joe McElvenney ximac at btinternet.com
Sat Aug 5 17:16:09 UTC 2006


Hi,

   While we are on the subject of PIC dividers, and if the lower
order outputs (other than 10kHz) are not required, the standard
divide-by-1000 part of a GPS-derived standard may easily be
implemented in an 8-pin 12F629/675 saving one chip and 20 pins.


My code, such as it is -


   Setup the required ports

DIV:

   Set RAn to '1'

   Stuff here with 124 NOPs

   Set RAn to '0'

   Stuff here with 121 NOPs

   Goto DIV


   The result, a synchronous counter with a symmetrical 10kHz
square-wave on RAn from a 10MHz clock input. The 245 NOPs are
easily block pasted into a text editor thus saving the need to
calculate the numbers for timing loops. This is so basic that I
hate to mention it but someone might wish to save a bit of board
space.


   Cheers - Joe
 





More information about the Time-nuts_lists.febo.com mailing list