First of all thank you for your comments.
I've previously tried all your suggestions, but it also didn't work. I need the interrupts to perform those blocks every second. If I use "delay" inside the loop, I lose the lamp reference and it starts to blink.
I also tried to change baud rate but it has no effect on the flickering (from 9600 to 115200).
As I said, without the "analogWrite" everything is working just perfect. I don't know what kind of interference it is causing in the whole program. Now I'll try change the PWM programming.