Hello!
I'm using a picaxe 28x2 with B.3 firmware and the 5.5.1 compiler version for windows.
I'm using 4 pwmout commands to control the speed of 4 motors. Each channel is connected to an l293d driver. Every channel of pwm have the same period and different duty cycles. After have initialized the pwmout i use the pwmduty command for changing the duty.
this is the code:
The strange thing is that only the last channel of pwm that starts present the strange behavior.
I haven't an oscilloscope but, when i measure the voltage of each port motor of the l293d, the last one that started have a different voltage from the others (approximately 2,5 volt), so, in this case, C.1 and C.2 that share the same timer have this issue.
But if change the order of stat up, for example, B.0 now is the last:
So now, only B.0 have the issue described above: the last that i started
If B.5 would be the last, only B.5 would have the problems.
I suggest that could be a problem of my program or a problem of the compiler, because always the last pwm that starts, has this issue.
How can i use all the 4 pwm channel together?
Thanks.
I'm using a picaxe 28x2 with B.3 firmware and the 5.5.1 compiler version for windows.
I'm using 4 pwmout commands to control the speed of 4 motors. Each channel is connected to an l293d driver. Every channel of pwm have the same period and different duty cycles. After have initialized the pwmout i use the pwmduty command for changing the duty.
this is the code:
Code:
begin:
pause 100
high B.7 , B.4 'move forward
low B.6 , B.3
pwmout pwmdiv4, B.5, 99, 200
pwmout pwmdiv4, B.0, 99, 200
pwmout pwmdiv4, C.1, 99, 200
pwmout pwmdiv4, C.2, 99, 200
main:
pwmduty B.5, 250
pwmduty B.0, 250
pwmduty C.1, 250
pwmduty C.2, 250
pause 4000
pwmduty B.5, 100
pwmduty B.0, 100
pwmduty C.1, 100
pwmduty C.2, 100
pause 4000
goto main
I haven't an oscilloscope but, when i measure the voltage of each port motor of the l293d, the last one that started have a different voltage from the others (approximately 2,5 volt), so, in this case, C.1 and C.2 that share the same timer have this issue.
But if change the order of stat up, for example, B.0 now is the last:
Code:
begin:
pause 100
high B.7 , B.4 'move forward
low B.6 , B.3
pwmout pwmdiv4, C.1, 99, 200
pwmout pwmdiv4, C.2, 99, 200
pwmout pwmdiv4, B.5, 99, 200
pwmout pwmdiv4, B.0, 99, 200
main:
pwmduty C.1, 250
pwmduty C.2, 250
pwmduty B.5, 250
pwmduty B.0, 250
pause 4000
pwmduty C.1, 100
pwmduty C.2, 100
pwmduty B.5, 100
pwmduty B.0, 100
pause 4000
goto main
If B.5 would be the last, only B.5 would have the problems.
I suggest that could be a problem of my program or a problem of the compiler, because always the last pwm that starts, has this issue.
How can i use all the 4 pwm channel together?
Thanks.