CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

timer0 in INT_EXT

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
holy
Guest







timer0 in INT_EXT
PostPosted: Sun Oct 31, 2004 7:11 pm     Reply with quote

I use timer0 and int_ext
why in my int_ext interrupt timer0 interrupt is disabled?
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Sun Oct 31, 2004 7:16 pm     Reply with quote

What PIC are you using?
In PIC16s you can not have interrupts inside other interrupts. The first thing the interrupt dispatcher does is to diable all the interrupts before entering the ISR.

Quoting from PIC16F877 datasheet:

Quote:
When an interrupt is responded to, the GIE bit is
cleared to disable any further interrupt, the return
address is pushed onto the stack and the PC is loaded
with 0004h.
holy
Guest







I
PostPosted: Mon Nov 01, 2004 9:17 am     Reply with quote

I use PIC18F4320

INT_RTCC (function1) 10ms
INT_EXT ( call delay 1s, when delay 1s need to function1

Can I do So?
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Mon Nov 01, 2004 3:58 pm     Reply with quote

You'd have to make the RTCC interrupt high priority by using the keyword 'fast'. From the manual:

Quote:
#INT_xxxx fast

The keyword FAST may be used with the PCH compiler to mark an interrupt high priority. A fast interrupt can interrupt another interrupt handler. The compiler does no save/restore in a fast ISR. You should do as little as possible and save any registers that need to be saved on your own.



By the way, avoid using delays in ISRs.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group