Searching \ for '[PIC]: ISR snippet' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/devices.htm?key=pic
Search entire site for: 'ISR snippet'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: ISR snippet'
2000\12\22@131218 by Drew Vassallo

picon face
Hi all,

Just looking through my code to try to reduce some cycles and came up with
this method for compensating for lost time during ISR servicing.

If you're doing a PWM loop or otherwise performing some loop count timing
and get interrupted, you might be able to compensate for the lost time with:

;; No context saving required.
btfsc   flag, 0    ; to indicate whether or not you're inside PWM loop
decfsz  counter    ; loop counter for PWM
retfie
incfsz  counter
retfie

Note that the last incfsz (not incf!) is needed so your counter doesn't go
below zero, which could hurt if you're using decfsz to monitor your loop
counter.  It would never skip the last retfie.

Of course, the path through the ISR has to be equal in time to the time
through one PWM loop for this to be at all valuable.

Just thought I'd throw it out there as a useful snippet if anyone is
intersted.

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2000\12\26@134256 by rich+piclist

flavicon
face
Cool!

> ;; No context saving required.
> btfsc   flag, 0    ; to indicate whether or not you're inside PWM loop
> decfsz  counter    ; loop counter for PWM
> retfie
> incfsz  counter
> retfie

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...