Go Down

Topic: Problem changing PWM frequency in Arduino Nano (Read 694 times) previous topic - next topic

guschaconrojas

I have set up the PWM according to my needs setting the registers TCCR1A (=0x40), TCCR1B (=0x0D) and OCR1A, and it is set in CTC mode with N=1024 (from page 123 from datasheet).

The problem is that I need to change the frequency very fast from 100 Hz to 1 kHz, and  whenever I do that the PWM signal takes over 10 seconds to update the frequency. In fact, when the change is set using the register OCR1A the output is high or low (no PWM output is presented during that time), and after a while the desired PWM output appears.

Any suggestion about that problem will be greatly appreciated.

Beforehand, thank you very much. 

PaulS

Quote
Any suggestion about that problem will be greatly appreciated.
Line 37. That's what my crystal ball says.

Actually, it said something else, too, but I censored that part.

Go Up