ISR(TIMER2_COMPA_vect) { //timer interrupt routine positionCounter = ((positionCounter + 1) % divisions); //position with modulo division PORTB=LED[positionCounter]; //getting the led values of the current position and clocking them in the portB output register.}

ISR(TIMER4_COMPA_vect) { //timer interrupt routine update=true;}

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.Do not send technical questions via personal messaging - they will be ignored.

cli(); //disable timersI always advise a little research before using a function. cli() does FAR more than disable timers. It stopps all interrupts. You can't do things that require interrupts while you have interrupts disabled. That means NO Serail.print() calls between cli() and sei().

You are assuming that it gets there. If the serial buffer gets full, Serial.print() blocks until there is room in the buffer. Making room in the buffer requires shifting data out, which requires interrupts, which you have disabled.