void init_port();
void init_timer();
void setup() {
// put your setup code here, to run once:
volatile long i = 0;
int j = 0;
init_port();
init_timer();
Serial.begin(9600);
while(1)
{
for (i = 0; i<500000; i++);
Serial.println(j,DEC);
j++;
}
}
void init_timer()
{
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 *portf_data = 0x31;
*portf_data ^= 0x01;
}
void init_port()
{
volatile char *portf_dir = 0x30;
*portf_dir = 0x01;
volatile char *portf_data = 0x31;
*portf_data = 0x00;
}
void loop() {
// put your main code here, to run repeatedly:
}