Problem with 16F88 controlling h-bridges
Hi,
I'm using PBP to create a pen plotter. I have made 6 h-bridges to control 3 stepper motors all of which seem to be functioning correctly. I had 4 of the h-bridges plotting when driven by a PICAXE (using an 18X - which is a pre-programed 16F88). I have since switched over to PBP and added an extra two bridges for pen up and down control.
I developed the PIC software using a breadboard and a set of LED's, making sure that the LEDs blink in the right order... this is now finished and working well, receiving data from the computer serial port and flashing accordingly.
However, when I come to plug the PIC into the circuit with the h-bridges, nothing happens. I've checked for shorts over and over again and can't seem to come up with anything... The only differences between the breadboard and veroboard with the h-bridges is that I have 100uF decoupling capacitor and a 4.7K pullup on RA5 on the veroboard. I can't think that these are the problem, and I added a cap and resistor to the breadboard and things seemed to be OK. However, I do remember that the first time I added the decoupling cap to the breadboard, the PIC behaved badly for a few seconds beforing settling down.
Any ideas what the problem could be? I've tried preprograming a routine of pulses so that the PIC isn't depending on the serial input. That still didn't work. It's as if the PIC simply isn't starting up.
Final question is with pin RA5. I wanted to use it as an input for the serial comms, but I couldn't get it working. I've set MCLR off, but it doesn't want to play ball. Any ideas what I could be doing wrong?
Thanks for your help... I'll go back to checking for shorts for the hundredth time :)
Are the configs burning correctly
Hi,
Disable MCLR and LVP (Low Voltage Programming) from the config. Burn the PIC and re-read it to make sure that the config fuses are being set okay. I remember someone mentioning that it was the programmer that was not setting the config fuses properly. As far as the BreadBoard to the VeroBoard transition: Try a little led blinky program to test that your PIC is properly reset and booting. A schematic post alongwith code would be nice.
Do the LEDs work on the Vero
Hi,
You mentioned that you tested the PIC on the breadboard using LEDs. Now you have hooked up Totem Pole output stages (I presume). So my questions are :
1. If you connect LEDs only and not the Transistor Driver What Happens ?
2. Are you powering the motors from the same supply as the PIC ?
3. Do the motors require higher than 5 volts ?
4. if the above is yes, then how have you translated the level.
Get some schematic (scans from the dustbin).
Your code seems okay. At least compiles okay. Although you have not set the TRISA bits as inputs it should be automatically handled by SERIN.
Seems the problem is at Driver Side
Hi,
If you are not overloading your PIC it should not heat up. Unless you are logically doing a short circuit. With the 1k resistors going to the base drive the PIC should be driving around 5ma and each port pin can drive something around 25ma.
I still need some info how you have hooked your half-bridge to the PIC. Taking your schematic into mind, if you cannot draw one please mention by text. Explain your half bridge as left part / right part and then the connection of the PIC to the NPN/PNP. I would draw up the schematic for you and then analyse.
You can also play with the TRIS bits to simulate a Z output (Tristate High Impedance style). Thus you get 3 states 1,0,Z.
Even if everything is electrically okay, motors can sometimes draw (they normally do) huge starting currents. This may trigger the brownout reset inside your PIC. One option is isolating the PIC supply from the motor. Or you may use (2+2) 4 general purpose diodes (say 1N4007) to power your PIC and Motor separately and having your PS at 6 volts. The two diodes approximately drops 1.2 volts so your PIC runs at around 4.8 volts. That means 2 diodes in series powers the PIC and the other two powers the driver. So your decoupling cap for the PIC is used for PIC only. (The drivers need them because if your driver is at 6 volts and your PIC outputs a 4.8 volt at logic 1 it is still going to fire your PNP transistor)
If you plan to use higher voltage for the motors then do use optos as they become your level translator.
This is not as complicated as it might look but I need to have the schematic exactly to understand possible cause.
(Temporary Variables in my mind are limited due to a faulty design by GOD):D