Searching \ for '[PIC]: interrupt handling in CCS-PICC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ints.htm?key=interrupt
Search entire site for: 'interrupt handling in CCS-PICC'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: interrupt handling in CCS-PICC'
2001\03\20@092925 by Edson Brusque

face
flavicon
face
Hello,

   is anyone here using the #INT_GLOBAL pragma in CCS-PICC?
   If yes, how do you do context saving?
   Do I need to save only the W and STATUS registers?
   Or do I need to save PCLATH also?

   Thank you very much,

   Brusque

-----------------------------------
Edson Brusque
Research and Development
C.I.Tronics Lighting Designers Ltda
(47) 323-2685  /  (47) 9993-6453
Blumenau  -  SC  -  Brazil
http://www.citronics.com.br
-----------------------------------

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\03\20@165952 by Brian Gregory

flavicon
face
>>  is anyone here using the #INT_GLOBAL pragma in CCS-PICC?
>>  If yes, how do you do context saving?
>>  Do I need to save only the W and STATUS registers?
>>  Or do I need to save PCLATH also?
>>
>>  Thank you very much,
>>
>>  Brusque

Stick this this principle:

You need to save everything you use which the main program might use.

So if you use PCLATH then yes you must save it and restore it.


Brian Gregory.
spam_OUTbriangTakeThisOuTspamcix.co.uk

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\03\21@062431 by Edson Brusque

face
flavicon
face
Hello Brian,

> You need to save everything you use which the main program might use.
> So if you use PCLATH then yes you must save it and restore it.

   thanks, it's a good answer... :)

   I've made some experiments and after some thought I'm now using (you
will find it very similar to the Microchip code on the PICs datasheets):

       #INT_GLOBAL
       void interrupt(void)
       {
           static byte s1_save;
           static byte s2_save;
           static byte s3_save;

           #asm
           // save registers
           MOVWF s1_save
           SWAPF STATUS,W
           BCF   STATUS,RP0
           BCF   STATUS,RP1
           MOVWF s2_save
           MOVF  PCLATH,W
           MOVWF s3_save
           CLRF  PCLATH
           #endasm

           if (INTCON.RTCC) {
               INTCON.RTCC = 0;
               // do that thing you do...
           }

           #asm
           // restore registers
           BCF   STATUS,RP0
           BCF   STATUS,RP1
           MOVF  s3_save,W
           MOVWF PCLATH
           SWAPF s2_save,W
           MOVWF STATUS
           SWAPF s1_save,F
           SWAPF s1_save,W
           #endasm
       }

   Best regards,

   Brusque

-----------------------------------
Edson Brusque
Research and Development
C.I.Tronics Lighting Designers Ltda
(47) 323-2685  /  (47) 9993-6453
Blumenau  -  SC  -  Brazil
http://www.citronics.com.br
-----------------------------------

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


2001\03\21@173053 by Brian Gregory

flavicon
face
{Quote hidden}

That's okay as long as you check the code produced for the C part of your
routine carefully to make sure it isn't using any other registers.

I would try and do the whole routine in assembler myself so I would know for
sure what registers it used.

Brian Gregory.
briangspamKILLspamcix.compulink.co.uk

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


2001\03\22@044311 by Oluseyi Odeinde

flavicon
picon face
Brusque,
conetxt saving is handled automatically by the compiler!

Edson Brusque wrote:

{Quote hidden}

--

Seyi Odeinde
Software Development Engineer
Earth-Ocean Systems
Instrumentation for extreme environments...earth - ocean - space

Email: seyispamspam_OUTearth-ocean.com
Tel: ++44 (0) 2920 875 183 - DL
    ++44 (0) 7799 537 184 - Mobile

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestKILLspamspammitvma.mit.edu


2001\03\22@055517 by Adlam Frank

flavicon
face
For the interest I wonder how do you apply interrupt priority in the C
compiler?  Software polling applied in the compiler - a setting somewhere?

{Original Message removed}

2001\03\22@084727 by Edson Brusque

face
flavicon
face
Hello Adlam,

> For the interest I wonder how do you apply interrupt priority in the C
> compiler?  Software polling applied in the compiler - a setting somewhere?

   in CCS-PICC you can specify it with a pragma like:

       #PRIORITY rtcc, rb

   Best regards,

   Brusque

-----------------------------------
Edson Brusque
Research and Development
C.I.Tronics Lighting Designers Ltda
(47) 323-2685  /  (47) 9993-6453
Blumenau  -  SC  -  Brazil
http://www.citronics.com.br
-----------------------------------

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


2001\03\22@084731 by Edson Brusque

face
flavicon
face
Hello Oluseyi,

> conetxt saving is handled automatically by the compiler!

   not if you're using #INT_GLOBAL. I'm using it because I don't feel the
CCS-PICC context saving is that optimal.

   Best regards,

   Brusque

-----------------------------------
Edson Brusque
Research and Development
C.I.Tronics Lighting Designers Ltda
(47) 323-2685  /  (47) 9993-6453
Blumenau  -  SC  -  Brazil
http://www.citronics.com.br
-----------------------------------

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


2001\03\22@112735 by Dale Botkin

flavicon
face
Normally, yes, but CCS provides the #INT_GLOBAL directive to shut it off
and let you do your own thing if you want.

On Thu, 22 Mar 2001, Oluseyi Odeinde wrote:

{Quote hidden}

---
The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny ..."
               -- Isaac Asimov

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


2001\03\22@112935 by Dale Botkin

flavicon
face
CCS has a #PRIORITY directive, which tells the interrupt handler which
interrupts get handled first if more than one occur at the same time.


On Thu, 22 Mar 2001, Adlam Frank wrote:

> For the interest I wonder how do you apply interrupt priority in the C
> compiler?  Software polling applied in the compiler - a setting somewhere?
>
> {Original Message removed}

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