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 CCS Technical Support

How to stop interrupt the TIMER0

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



Joined: 23 Jan 2010
Posts: 1

View user's profile Send private message

How to stop interrupt the TIMER0
PostPosted: Sat Jan 23, 2010 4:55 am     Reply with quote

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);
    }
   }
}
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