How to use Arduino interrupt in GR Sakura?


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


//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: .I clicked guest login and selected gr sakura board v1.07.

So arduino dosen’t have…

A user friendly function interface for Interrupts ? Like a library of some sort like it has for servo…etc ? I had to write like 15 lines of code for a 1 sec interrupt .Something like InterreptTimer1(1000) could have been cool…

On second thought I think I will have to dig the datasheet…

Thanks fellas for replying…

I found the answer to my problem (as hinted by bajdi) so case closed.

For anyone else who stumbles here I decided to write a blog on it ( Introduction to GR Sakura ).

Here’s the link: