Creating the pulses you want is made very easy using the Output Compare mod= ules in the more recent processors. I did a pulse generation system in a PIC24 where we needed three periodic p= ulses with known delays between them. Using three Output Compare modules sy= nchronised to the same reset pulse and clocked together made it real easy. = You could do a similar thing using two modules, one to generate the one sec= ond wide pulse, and the second to generate a one clock wide pulse for the s= trobe 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! >=20 > 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 s= etup > 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 ti= me > that corresponds to the pot setting, send out the reset pulse, open the g= ate > for one second, and repeat these steps forever. > Correct? > Thanks, > rich! > P.S. This looks like an outline for the program. Correct? > rich! >=20 > 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! > > > > On 7/18/2014 2:56 AM, IVP wrote: > >>> I could figure out MPASM but MP C would be much easier > >> It should be simple enough in asm > >> > >> So far there are only a few basic functions - get the clock going, > >> read the pot and do something with the result > >> > >> It's not as though the PIC needs to do a lot of calculations for > >> example, it's just reacting and supervising > >> > >> Joe >=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 .