Message Edited by pIx on 2006-09-20 07:32 AM
TFLG1 = (1<<4); // clears OC interrupt flg for TC4
TIE &= ~(1<<4); // disables interrupts on TC4
TC4 = TCNT + 0x100 // set a new time for event 256 ticks from now TFLG1 = (1<<4); // clear previously ignored flag, no matter if was already 0 TIE = (1<<4); // enable interrupt
Message Edited by imajeff on 2006-09-21 11:47 AM
Message Edited by pIx on 2006-09-2201:00 PM
pIx wrote:
imajeff: you had written:
TC4 = TCNT + 0x100 // set a new time for event 256 ticks from now
The doubt I have is, what if TCNT is lets say 200 ticks away from an overflow and being reset, what exactly will happen if I try to put TCNT + 0x100 into it?