_VERY_ nice! An excellent example of looking beyond the obvious. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) ----- Original Message ----- From: Snail Instruments To: Sent: Friday, September 29, 2000 7:46 AM Subject: Re: [PIC]: interrupt accuracy > Using the compare register is the way to go. Set no prescaler on TMR1, set > the CCP module for the special event and load CCPxL & CCPxH register pair > with the desired period _MINUS ONE_. Just make sure you substitute CCPxIF > for TMR1IF (TMR1IF never gets set, since TMR1 never overflows). Both CCP1 > and CCP2 work equally well. > > Josef > > >>Any suggestions on where I might be able to improve the code to get a > >>1ms interrupt happening that I can rely on? I am relatively new to C > >>and brand new to PICs so all comments are apprieciated. > >> > >With Timer1, try using the "special event trigger" interrupt mode > >- selected by CCP1CON = xxxx1011. This way you initialize Timer1 > >once, and the value acts as the interrupt "period". > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > "[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: "[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's