void setup() {
PORTf_init();
Timer_init();
Serial.begin(9600);
while(1)
{
}
}
void loop() {
// put your main code here, to run repeatedly:
}
void PORTf_init()
{
volatile char *dirf=0x30;
volatile char *outf=0x31;
*dirf=0x01;
}
void Timer_init()
{
volatile char *timer1_TCCR1A=0x80;
volatile char *timer1_TCCR1B=0x81;
volatile short *timer1_TCNT1=0x84;
volatile short *timer1_OCR1A=0x88;
volatile char *timer1_TIMSK1=0x6f;
*timer1_TCCR1A=0;
*timer1_TCCR1B=0;
*timer1_TCNT1 =0;
*timer1_OCR1A=60000;
*timer1_TCCR1B=0x0c;
*timer1_TIMSK1=0x02;
}
ISR(TIMER1_COMPA_vect)
{
volatile char *outf=0x31;
*outf = *outf ^ 0x01;
}