Tiho Tian

TSC0_CH0F - MC68HC908JK1CP

Discussion created by Tiho Tian on Feb 4, 2008
Latest reply on Feb 5, 2008 by Ake Webjorn
Hi everybody
I'm working with MC68HC908JK1CP
I would like to reach the interrupt routine during TIM Channel 0 overflow. Here is my code. TCH0L = TCNTL but CH0F bit is always equal to 0. I think that something is missing here.
Thank you in advance.
 
 
EnableInterrupts; /* enable interrupts */
  /* include your code here */
  TSC_TSTOP = 1; //counter stopped;
  TSC_TRST = 1;  //reset counter;
  TSC_PS0 = 0;
  TSC_PS1 = 1;
  TSC_PS2 = 1;  
  
  TCH0L = 20;
  TCH0H = 20;
  TSC0 = 112;

  TSC_TSTOP = 0;
    for(;:smileywink: {
  if (TCH0L == TCNTL && TCH0H == TCNTH)
   if (TSC_TOF == 1) 
      {
        TSC0_CH0IE = 1;
              
      }
    __RESET_WATCHDOG(); /* feeds the dog */
  } /* loop forever */
  /* please make sure that you never leave this function */
}
 
interrupt 4 void prek4(){
  
  TSC0_CH0IE = 0;
  TSC0_CH0F = 0;
 
  TSC_TRST = 1;
  
}
 
 
Added p/n to subject.


Message Edited by NLFSJ on 2008-02-05 07:44 AM

Outcomes