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

interrupt issue

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



Joined: 07 May 2005
Posts: 28
Location: Campbell, CA

View user's profile Send private message

interrupt issue
PostPosted: Mon May 23, 2005 9:23 pm     Reply with quote

I'm using several interrupts (TMR0, AD, RDA).

Whenever I execute the line:

disable_interrupts(int_RDA);

It seems to disable ALL the interrupts. When I execute the line:

enable_interrupts(int_RDA);

The interrupts start working again.
Why would disabling one interrupt affect all interrupts?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon May 23, 2005 9:49 pm     Reply with quote

It shouldn't
Charles Linquist



Joined: 07 May 2005
Posts: 28
Location: Campbell, CA

View user's profile Send private message

PostPosted: Mon May 23, 2005 9:56 pm     Reply with quote

I'm thinking that the issue could be because I'm disabling the interrupt INSIDE the ISR. I'm enabling it again before the routine exits.

Is that allowed?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon May 23, 2005 10:19 pm     Reply with quote

I noticed in another post that you're doing this:
Quote:
#use rs232(BAUD=9600,XMIT=PIN_C6,RCV=PIN_C7)

If you do this and you're shutting off interrupts at various times,
I think it's likely that you're getting a locked-up UART receiver.


You should be doing this:
Quote:
#use rs232(BAUD=9600,XMIT=PIN_C6,RCV=PIN_C7,ERRORS)

You should always do it that way.
Charles Linquist



Joined: 07 May 2005
Posts: 28
Location: Campbell, CA

View user's profile Send private message

PostPosted: Mon May 23, 2005 11:17 pm     Reply with quote

Thanks, I had already added that statement.

I found my problem.... I had a "leak" in one of my routines that shut off and re-enabled global ints by mistake.

Right now, I think I should stop trying to add functionality, and focus on style, readability and accuracy.
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