void init_port(void);
void init_timer();
void setup() {
// put your setup code here, to run once:
volatile long i;
int j=0;
init_port();
init_timer();
Serial.begin(9600);
while(1)
{
for(i=0;i<100000;i++);
Serial.println(j,DEC);
j++;
}
}
void init_timer()
{
volatile char *Timer_TCCR1A = 0x80;
volatile char *Timer_TCCR1B = 0x81;
volatile short *Timer_TCNT1 = 0x84;
volatile short *Timer_OCR1A = 0x88;
volatile char *Timer_T1MSK1 = 0x6f;
*Timer_TCCR1A = 0;
*Timer_TCCR1B = 0;
*Timer_TCNT1 = 0;
*Timer_OCR1A = 60000;
*Timer_TCCR1B = 0x0c;
*Timer_T1MSK1 = 0x02;
}
void init_port()
{
volatile char *portf_dir =(volatile char *) 0x30;
*portf_dir = 0x01;
}
ISR(TIMER1_COMPA_vect)
{
volatile char *portf_data =(volatile char *) 0x31;
*portf_data ^= 0x01;
}
void loop() {
// put your main code here, to run repeatedly:
}