I have a doubt that wanted to share with all of u
I have programmed two timers of the microcontroller (ATMEL 128) to obtain two pwm signals to modulate the power of a DC motor.
The thing is that if, in the main programm, if I just set the 2 pwm to a value (set_pwm1(50) , set_pwm2(100) for example) works, and the motor runs wonderfully at that velocity. But, if I want to have different velocities, for example after one minute running with velocity "A" I want it to change to the double the velocity (ste_pwm1(100), set_pwm(200) )
it just run with the same original velocity and doesn't seem to notice that I set other parameters to the timers!!!
The timers are well programmed, because when using the whole time the same velocity it works, but I just don't know why the motor does not change the velocity when I change the settings of the timer (the OCRn value)!!! It's weird!
Could it be that it can not make abrupt changes?
By the way I am not using any interrupt...
mmm I hope I was clear enough... I didn't attach the file because it's just that: set_velocity, wait a minute, change velocity
if needed I could attach it of course.
Thank u for your time guys!