#include <avr/io.h>
#include <util/delay.h>
#include <avr/signal.h>
#include <avr/interrupt.h>
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned long ULONG;
USHORT Time; // 카운터 Ref
int main(void)
{
DDRB = 0xff;
TIMSK = _BV(TICIE1);
TCCR1A = _BV(COM1A0); // OC1A Toggle
TCCR1B = _BV(WGM12)|_BV(CS10); // CTC, 4MODE, 8 divide
Time = 999; //
TCNT1 = 0;
OCR1AH = (Time & 0xff00) >> 8; //
OCR1AL = Time & 0x0ff; //
ETIMSK = _BV(TICIE3);
TCCR3A = _BV(COM3A0); // OC3A Toggle
TCCR3B = _BV(WGM32)|_BV(CS30);// CTC, 4MODE, 8 divide
Time = 999; //
TCNT3 = 0;
OCR3AH = (Time & 0xff00) >> 8; //
OCR3AL = Time & 0x0ff; //
SREG |= 0x80;
while(1);
}
SIGNAL(SIG_INPUT_CAPTURE3)
{
}
SIGNAL(SIG_INPUT_CAPTURE1)
{
}