|
|
View previous topic :: View next topic |
Author |
Message |
PCM Novice Guest
|
disable one interrupt from another interrupt routine |
Posted: Tue Dec 24, 2002 4:10 am |
|
|
<font face="Courier New" size=-1>I was trying to do the following on a 18F452 does it make sense?
Does the diable_interrupts fuction work within an intterupt routine, and can it be used without the disable_interrupts(global)?
#int_RDA
RDA_isr()
{
char ch;
enable_interrupts(INT_TIMER2); // enable timer 2 interrupt
set_timer2(0);
timer_timeout = FALSE;
ch = getc();
}
#int_TIMER2
TIMER2_isr() {
timer_timeout = TRUE;
disable_interrupts(INT_TIMER2); // disable this interrupt untill another character is received.
}
// Happy Christmas!</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 10250 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: disable one interrupt from another interrupt routine |
Posted: Tue Dec 24, 2002 12:57 pm |
|
|
<font face="Courier New" size=-1>I did something similar on a 16C77, in which I had an interrupt
driven keypad routine. When a key was pressed, an INT_RB would
occur. In the INT_RB isr, I started a timer and enabled
interrupts for it. This provided the debounce delay.
When the timer interrupt occurred, I disabled its interrupt,
re-enabled the INT_RB (which I had disabled in the INT_RB isr),
and read the keypad. GLOBAL interrupts were always enabled.
</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 10253 |
|
|
PCM Novice Guest
|
Re: disable one interrupt from another interrupt routine |
Posted: Fri Dec 27, 2002 2:31 pm |
|
|
'Sounds like it may work. I'll try it and hope that the 18F interrupt priorities don't cause problems.
Thanks
:=<font face="Courier New" size=-1>I did something similar on a 16C77, in which I had an interrupt
:=driven keypad routine. When a key was pressed, an INT_RB would
:=occur. In the INT_RB isr, I started a timer and enabled
:=interrupts for it. This provided the debounce delay.
:=When the timer interrupt occurred, I disabled its interrupt,
:=re-enabled the INT_RB (which I had disabled in the INT_RB isr),
:=and read the keypad. GLOBAL interrupts were always enabled.
:=
:=
:=</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 10273 |
|
|
|
|
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
|