View previous topic :: View next topic |
Author |
Message |
Charles Linquist
Joined: 07 May 2005 Posts: 28 Location: Campbell, CA
|
interrupt issue |
Posted: Mon May 23, 2005 9:23 pm |
|
|
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
|
|
Posted: Mon May 23, 2005 9:49 pm |
|
|
It shouldn't |
|
|
Charles Linquist
Joined: 07 May 2005 Posts: 28 Location: Campbell, CA
|
|
Posted: Mon May 23, 2005 9:56 pm |
|
|
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
|
|
Posted: Mon May 23, 2005 10:19 pm |
|
|
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
|
|
Posted: Mon May 23, 2005 11:17 pm |
|
|
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. |
|
|
|