Hi,
I successfully ran a code snippet on Arduino . The arduino code uses timer 1 for interrupt and looks like this...
void setup() {
cli();//clear interrupt
//set timer1 interrupt at 1Hz
TCCR1A = 0;// set entire TCCR1A register to 0
TCCR1B = 0;// same for TCCR1B
TCNT1 = 0;//initialize counter value to 0
OCR1A = 15624;// set compare match register for 1hz increments // = (16*10^6) / (1*1024) - 1
TCCR1B |= (1 << WGM12);// turn on CTC mode
TCCR1B |= (1 << CS12) | (1 << CS10); // Set CS12 and CS10 bits for 1024 prescaler
TIMSK1 |= (1 << OCIE1A);// enable timer compare interrupt
sei();//allow interrupts
}
and in ISR
ISR(TIMER1_COMPA_vect){
//command for interrupt here
}
The above code worked well for arduino and compiled successfully.
But sakura web compiler gives errors. (Says it doesn't know cli,TCCR1A,TCCR1B etc..)
How do I make arduino interupts to work with GR sakura?
Here's the cloud compiler if you're interested in it:
http://www.renesas.com/products/promotion/gr/index.jsp#cloud .I clicked guest login and selected gr sakura board v1.07.