Hello.
Hopefully someone might be able to help me with PWMOUT on a 08M chip.
What am I trying to achieve?
I would like to control the speed of a 3volt motor from the same power source as the PICAXE. At this stage until I get it working, my code should turn the motor on for 2 seconds then off for 2 seconds and rotate at a speed specified by the PWMOUT command.
What have I done?
I have copied the wiring diagram as per the PICAXE manual 3 page 15 with output 2 going to the enable pin of the L293D chip. PICAXE pins 1 & 4 connect with pins 2 & 7 on the L293D to control the direction. I have also put a green-cap across the motor terminals and programmed the PIC with the code below.
What is the issue?
The issue is that unless the duty cycle is 100%, the motor does nothing and the PICAXE starts to get very hot! I had also at one stage added code to enable an LED on output pin 1 to blink. This would indicate that the chip/program was working fine. Once again, if the duty cycle was anything other the 100% the LED would not work at all.
I have tried two different motors with the same result.
As you can see from the code I have tried a few different combinations of the PWMOUT command.
I have also used other code (not listed here) to test that I can control the brightness of and LED on that pin and that works as suspected. Could the L293D chip be at fault?
Hopefully I have just missed something.
Cheers.
Hopefully someone might be able to help me with PWMOUT on a 08M chip.
What am I trying to achieve?
I would like to control the speed of a 3volt motor from the same power source as the PICAXE. At this stage until I get it working, my code should turn the motor on for 2 seconds then off for 2 seconds and rotate at a speed specified by the PWMOUT command.
What have I done?
I have copied the wiring diagram as per the PICAXE manual 3 page 15 with output 2 going to the enable pin of the L293D chip. PICAXE pins 1 & 4 connect with pins 2 & 7 on the L293D to control the direction. I have also put a green-cap across the motor terminals and programmed the PIC with the code below.
What is the issue?
The issue is that unless the duty cycle is 100%, the motor does nothing and the PICAXE starts to get very hot! I had also at one stage added code to enable an LED on output pin 1 to blink. This would indicate that the chip/program was working fine. Once again, if the duty cycle was anything other the 100% the LED would not work at all.
I have tried two different motors with the same result.
As you can see from the code I have tried a few different combinations of the PWMOUT command.
I have also used other code (not listed here) to test that I can control the brightness of and LED on that pin and that works as suspected. Could the L293D chip be at fault?
Code:
low 1
low 4
;pwmout 2,150,100 ‘ set pwm
;pwmout 2 , 41, 83
;pwmout 2 , 44, 164; 22000- 90%
;pwmout 2 , 41, 150; 24000- 90%
;pwmout 2 , 37, 138; 26000 - 90%
;pwmout 2 , 52, 189; 19000 - 90%
;pwmout 2 , 99, 400; 1000 - 100% No overheating, no speed control
;pwmout 2 , 99, 200; 1000 - 50%
;pwmout 2 , 99, 360; 1000 - 90%
;pwmout 2 , 32, 67;30000 - 90%
pwmout 2 , 199, 800;5000 - 100% No overheating, no speed control
;pwmout 2 , 199, 700
main:
high 1
pause 2000
low 1
pause 2000
goto main ‘ loop back to start
Cheers.