Hello everyone,
I have managed to control a DC motor using the pwm module on the 16f877a. I tried to vary the duty cycle and it worked flawlessly although at 20% or less duty cycle the motor would not even turn.
Now I want to control the direction of rotation of the motor based on user input. So I am using a small mechanical switch. It gets power from a 5V supply to simulate the logical high and logical low states.
So when the switch is "on" the output is a logical high or 5V. But when the switch is in the "off" state it does not output a logical low. Instead there is no measurable output what so ever... I believe logical low would be 20% to 25% of logical high. But in this case the switch output 0% in the "off" state.
Is there any alternate method I can use to perform the same or is there any modification I can make to the existing circuit to make it output a logical low?
Thank you.
I have managed to control a DC motor using the pwm module on the 16f877a. I tried to vary the duty cycle and it worked flawlessly although at 20% or less duty cycle the motor would not even turn.
Now I want to control the direction of rotation of the motor based on user input. So I am using a small mechanical switch. It gets power from a 5V supply to simulate the logical high and logical low states.
So when the switch is "on" the output is a logical high or 5V. But when the switch is in the "off" state it does not output a logical low. Instead there is no measurable output what so ever... I believe logical low would be 20% to 25% of logical high. But in this case the switch output 0% in the "off" state.
Is there any alternate method I can use to perform the same or is there any modification I can make to the existing circuit to make it output a logical low?
Thank you.