Hello, and welcome to the forum.
There may be some confusion about timer overflow, and output compare operation. Timer overflow pertains to all channels of the TIM module, and occurs when TCNT is equal to the TMOD value. The output compare is applicable to individual channels, and with the channel setting you have (would be much easier to read a hxadecimal, rather than decimal value), an interrupt will occur whenever register TCNT is equal to TCHO, a value of 0x1414.
It is unclear what you are attempting to achieve.
Your ISR simply clears the interrupt flag, and disables further channel interrupts. You also zero the timer.
With the test in your main loop, it is quite possible that this will very rarely succeed since any match is a transient event that mostly won't occur at the time the test is made. You should restrict the test to the upper byte value, or test the CH0F flag instead.
After testing the timer overflow flag, you do not clear the flag.
If you simply wish to generate a periodic timer interrupt, It is much simpler to increment the TCH0 value by a fixed amount, within the channel ISR.
Regards,
Mac
Message Edited by bigmac on
2008-02-05 10:07 PM