Hi all, I’m tried to use the interruption from Timer2_ovf and Timer0_ovf an atmega128 but it doesn’t work out. The INT0 and INT1 vector work fine. I’m posting my code so that you could figure out.
Dont know the answer but dont think it is anything todo with FreeRTOS so must just be in the register settings. Are there examples in the compiler to copy?
/* Setup compare match value for compare match A. Interrupts are disabled
before this is called so we need not worry here. */
ucLowByte = ( unsigned portCHAR ) ( ulCompareMatch & ( unsigned portLONG ) 0xff );
ulCompareMatch >>= 8;
ucHighByte = ( unsigned portCHAR ) ( ulCompareMatch & ( unsigned portLONG ) 0xff );
OCR1AH = ucHighByte;
OCR1AL = ucLowByte;
//Change to OCR3AH and AL
/* Setup clock source and compare match behaviour. */
ucLowByte = portCLEAR_COUNTER_ON_MATCH | portPRESCALE_64;
TCCR1B = ucLowByte;
// Make sure the correct register for TIMER3
/* Enable the interrupt - this is okay as interrupt are currently globally
disabled. */
ucLowByte = TIMSK;
ucLowByte |= portCOMPARE_MATCH_A_INTERRUPT_ENABLE;
TIMSK = ucLowByte;
}