View previous topic :: View next topic |
Author |
Message |
Frans
Joined: 19 Jan 2004 Posts: 5
|
how To use FAST interupt handeling CCS |
Posted: Wed Jan 21, 2004 5:03 am |
|
|
Hi there,
I using the CSS compiler, with the PIC 16F876A at 8Mhz
The problem is my interupt handeling (status saving) is to slow.
Now i read in the manual something about FAST Int handeling.
Is someone familiar with this, and how to do the trick?.
Thanks
Frans.n |
|
|
Felix Althaus
Joined: 09 Sep 2003 Posts: 67 Location: Winterthur, Switzerland
|
|
Posted: Wed Jan 21, 2004 5:22 am |
|
|
What do you have to do in your interrupt service routine?
mfg
Felix |
|
|
Frans
Joined: 19 Jan 2004 Posts: 5
|
|
Posted: Wed Jan 21, 2004 5:34 am |
|
|
it's an Uart Int handeling at 200000 baud. it's critical up now.
Frans |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Jan 21, 2004 7:03 am |
|
|
You are referring to high/low priorty interrupts which are available on the PIC18's. You are probably trying to do too much in your interrupt handler. Post your isr and we can recommend possibly a better way of doing it. |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
|
Posted: Wed Jan 21, 2004 9:44 am |
|
|
Frans wrote: | it's an Uart Int handeling at 200000 baud. it's critical up now.
Frans |
You should use a RTS and DTR line to make this work. 200K baud is very fast specialy with an 8Mhz oscilator. If you stay in the interupt the entire time you are recieving it may work. When the RST line from the PC comes on it should cause a interupt on pin B0. Once within the interupt function set the DTR line and the PC will beging sending data. |
|
|
Ttelmah Guest
|
Re: how To use FAST interupt handeling CCS |
Posted: Wed Jan 21, 2004 11:05 am |
|
|
Frans wrote: | Hi there,
I using the CSS compiler, with the PIC 16F876A at 8Mhz
The problem is my interupt handeling (status saving) is to slow.
Now i read in the manual something about FAST Int handeling.
Is someone familiar with this, and how to do the trick?.
Thanks
Frans.n |
The 16F family, does not support 'fast' interrupts.
Basically, there are two seperate control functions. The first is 'priority', which allows you to specify which order the code will check interrupts. This works with any chip version.
The second is 'fast', which can only be used on chips that support hardware interrupt priorities (the 18F etc.). This has significant 'issues' on some chips.
Now, you can generate quite 'fast' interrupt handling, using 'trick' code. If you replace the INT_GLOBAL routine, save just the BSR, STATUS, and W registers, then check for your 'important' interrupt, and jump to it's handler, _provided_ this handler is kept simple (no use of table pointers, subroutines etc.), you can execute this routine, and simply exit restoring just these three registers. You can approximately halve the overhead associated with the normal handler this way, _but_, only if you are very careful in the code for the handler. The int_global, if necessary, can then save other registers (the SCRATCH area, and table pointers), and check for other interrupts.
Best Wishes |
|
|
|