Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

How to manually trigger a counter interrupt

2005-04-17 by arhodes19044

I am using TC1 to time milliseconds for a real-time clock.  I am using 
a prescale of 1 and count to 16,000.  I could use a larger prescale, 
but this way I can adjust the clock speed slightly.

I also want to manually trigger one of the other counter channels 
(OC1C) to cause the execution of another separate interrupt.

The ATmega docs say that  I just need to raise the OCF1C in ETIFR and 
then the interrupt will be executed (on the next clock tick, I 
suppose).  Of course the interrupts need to be globally enabled.  I 
did not set the OCIE1C bit because I do not want it automatically 
counting.  When I tested the function, it did not seem to   trip the 
interrupt.

What do I do to get this technique to work?

-Tony

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.