Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

GIPO pin cuts voltage to microcontroller in hardware

Status
Not open for further replies.

Cantafford

Member
Hello,

I have made a project in which I control the speed and direction of a small DC motor using a PIC18f2550 microcontroller and an integrated L293D half bridge. I have simulated it in Proteus and it works fine.


The L293D truth table is this:
33ubqx4.jpg


This is my schematic:
29axxn9.png


As I'm sure it's obvious the project is supposed to work this way:
-I press one of the buttons to select direction: CW or CW(RB0 or RB1).
-then I select a speed from Rb2-Rb5 in ratios of 1/4(25%, 50%, 75%, 100%). The CCP1 of the PIC is connected to the enable pin of the L293D to send the PWM signal.

The program is supposed to let me select a direction then the speed in four ratios. It works fine in Proteus.


However I implemented it in hardware and I have one problem: When I select the speed to be 75%(press the RB5 button) the speed goes briefly to 100%(full pwm signal) then the motor stops and no further commands can be given(I have to reconnect the power supply to make it work again). Again this is not happening in simulation only in hardware.

Now this pin is the PGM pin. I have googled and I found out that you need to turn off LVP(low voltage programming) in order to use that as a GPIO pin. If I try to set LVP to 0 the program that not work at all(at least in hardware have not tried that in proteus).

I have made two videos to make it clearer what my problem is:

1. Proteus simulation:
**broken link removed**

2. Hardware implementation:
**broken link removed**

I'm guessing it's a software issue but it seems strange to me that it works in proteus.
 
What is wrong? What happens?
Do you have an oscilloscope? Can you see what is happening on the three pins. IN1, IN2, EN1 ?
 
Check the physical connections. MCLR pin etc. Maybe there is a small short somewhere.
 
I have switched it to another PIN and it works fine. It must be something on the PGM pin that you must do before you use it.(in hardware) that I'm missing out.
 
Status
Not open for further replies.

Latest threads

Back
Top