Ttelmah Guest
|
|
Posted: Mon May 11, 2009 8:21 am |
|
|
No 'simple' steps.
The answer, will depend on whether you have any other interrupts in use, and what your code needs to do in the ISR.
The 'standard' ISR handler, perhaps doubles the overhead from the 'best case', but the latter requires _you_ to have learnt enough about the chip, to know exactly what registers are used inside the ISR.
If no other interrupts are in use, look at the example 'ex_glint.c', which shows the fastest way on a PIC16. On the PIC18, this can be improved a little, by using the RETFIE 1 instruction, but the basic format, remains correct. This example, only uses the minimum registers, and anything more complex, will require manual saving of more registers than this.
This is not something to do, if you are 'new to the PIC'. You need to read and understand the data sheet, and do a search here about interrupt handlers. More complex examples have been posted, showing how things have to expand for more than one interrupt, and for more registers.
Think of this like some quite complex piece of off-road driving. You need to learn how to actually drive _first_...
Best Wishes |
|