Interrupt handling

Post your requests and ideas on the future development of mikroPascal for dsPIC30/33 and PIC24.
Post Reply
Author
Message
faramir
Posts: 9
Joined: 30 Aug 2007 16:07

Interrupt handling

#1 Post by faramir » 30 Dec 2007 16:43

I psoted this in form of a question some time ago but received no reply, therefore I decided to rephrase it as a couple of suggestions:

1: Add a directive that instructs the compiler not to push&pop certain registers when an interrupt occurs. This is similar to how register handling is done on VAX, for those of you who're familar with VAX assembly :) Why woudl this be useful ? Pushing and popping entire working register array takes plenty of cycles - sometiems it takes to long. If user could instruct the compiler not to push&pop registers that aren't used in interrupt handler, valuable cycles would be saved.

Something along the lines of {$MASK W9, W11, W12} would instruct the compiler not to generate push/pop pairs for registers W9, W11 and W12.

2: Add the option to implement interrupt handlers solely in assembly (short of RETFIE, of course). This is directly related to my first suggestion; if none of the registers are to be saved this would allow interrupt handler to contain only assembly code, allowing more efficient interrupt handlers for time-critical applications.

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

#2 Post by jpc » 30 Dec 2007 17:38

In the last version of the pic-compiler DisableContextSaving was introduced allowing for similar improvements on PIC , i can imagine this to be implemented in the next dsPIC compilers too.

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

Re: Interrupt handling

#3 Post by yo2lio » 30 Dec 2007 19:02

faramir wrote:Pushing and popping entire working register array takes plenty of cycles - sometiems it takes to long ...
It's too much for you 17 cycles for saving and 17 cycles for restore all working registers ?
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

faramir
Posts: 9
Joined: 30 Aug 2007 16:07

Re: Interrupt handling

#4 Post by faramir » 08 Jan 2008 13:48

yo2lio wrote:
faramir wrote:Pushing and popping entire working register array takes plenty of cycles - sometiems it takes to long ...
It's too much for you 17 cycles for saving and 17 cycles for restore all working registers ?
Yep, way too much; at maximum speed of 30 MIPS and with 1 msps A/D conversion this doesn't leave any room for immediate data processing whereas adjustable context switch would leave 10-20 cycles, restoring only those registers that actually get clobbered in the ISR. Not only that, it would also leave some spare cycles for the main loop ...

Post Reply

Return to “mikroPascal for dsPIC30/33 and PIC24 Wish List”