s0011513
Joined: 23 Jan 2010 Posts: 1
|
How to stop interrupt the TIMER0 |
Posted: Sat Jan 23, 2010 4:55 am |
|
|
Hi,
When EXTERNAL INTERRUPT is clear(High to low). I want to stop INTERRUPT TIMER0.
How to stop interrupt the TIMER0?
Can I use "disable_interrupts(INT_TIMER0);" in order to stop interrupt timer0?
Code: |
#include <16F688.h>
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C4, rcv=PIN_C5)
unsigned int i=0;
#INT_TIMER0
void Timer0_ISR()
{
i++;
}
#INT_EXT
void EXT_ISR()
{
disable_interrupts(INT_TIMER0);
printf("%d",i);
}
void main ()
{
enable_interrupts(GLOBAL);
enable_interrupts(INT_TIMER0);
enable_interrupts(INT_EXT);
ext_int_edge(H_TO_L);
while (TRUE)
{
if(!input(PIN_A0))
{
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
set_timer0(0);
}
}
}
|
|
|