No, the comparator modules are not the Output Compare modules.=20 The Output Compare modules are often used to generate PWM or similar, the c= omparator modules are analogue peripherals. >=20 > Alan, > It still sounds like the 628 would be the one to use. It has compara= tor units > in it. For a moment I thought I knew what to do and then I lost it. Hum. > Would someone please take the time to sit down and write some C code that > would do these things? I know that I am asking a lot but I really need th= e help > with this. > Thanks, > rich! >=20 > On 7/18/2014 3:47 AM, alan.b.pearce@stfc.ac.uk wrote: > > Creating the pulses you want is made very easy using the Output Compare > modules in the more recent processors. > > > > I did a pulse generation system in a PIC24 where we needed three period= ic > pulses with known delays between them. Using three Output Compare > modules synchronised to the same reset pulse and clocked together made it > real easy. You could do a similar thing using two modules, one to generat= e > the one second wide pulse, and the second to generate a one clock wide > pulse for the strobe signal you want, which could be delayed from the one > second pulse by one clock pulse. > > > > > > > >> -----Original Message----- > >> From: Richard R. Pope [mailto:mechanic_2@charter.net] > >> Sent: 18 July 2014 09:20 > >> To: Microcontroller discussion list - Public. > >> Subject: Re: [Pic] Making a special timer! > >> > >> Hello, > >> I'm replying to myself because it is the part about controlling > >> the one second pulse that I just don't know how to do. Do I use a > >> timer or do I setup a set of delay loops. The more accurate the one > >> second pulse the more accurate that the frequency being displayed is > >> going to be. A 4MHz clock means that 1 megacycles are executed in one > >> second. So, you do the initialization, open the gate for one second, > >> read the pot, wait for a time that corresponds to the pot setting, > >> send out the reset pulse, open the gate for one second, and repeat the= se > steps forever. > >> Correct? > >> Thanks, > >> rich! > >> P.S. This looks like an outline for the program. Correct? > >> rich! > >> > >> On 7/18/2014 3:03 AM, Richard R. Pope wrote: > >>> Joe, > >>> That is true. Setup a clock the can output a high for one > >>> second on demand. Read the POT, output the reset pulse, turn on the > >>> one second clock that corresponds to the setting of the POT, and do > >>> it all over again. Is that correct? > >>> Thanks, > >>> rich! > >>> > >>> >=20 > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 Scanned by iCritical. --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .