#define FIREFREQUENCY 3 ... #pragma vector=TIMER0_OVF0_vect __interrupt void Fire_Interrupt(void); ... volatile struct bitstates { u8 zc:1; //Zerocrossing, =1 now in the pos HW, =0 neg. HW present u8 fired:1; u8 lv:1; //"1" measure Linevoltage }state; ... /*----------------------------------------------------------------------------- ROUTINE Name : Fire_Interrupt Description: fires the triac Input/Output: None/state.fired -----------------------------------------------------------------------------*/ __interrupt void Fire_Interrupt(void) { u8 k; TCCR0=0x00; // stop timer for(k=0;k