Feed pulses into tock0 preload with 163 and each int or rollover is result as andrew wrote below Steve... -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Andrew Warren Sent: 22 November 2002 22:52 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [OT]:Need to divide Frequency by 163. Vic Lopez wrote: > I am in need to divide a 12.5 Mhz clock by 163. How can this be done > with a counter? I know that if this division were a power of two, then > it would be very straight forward, but this is not my case at all. > .... yes, it is a square wave. Vic: Build a counter that increments on every edge of your input clock. When the counter reaches 163, reset it to 0 and toggle your output. -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: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu