Sign in to follow this  
rickalty

What am I doing wrong?

Recommended Posts

Hi everyone. Im trying to get a RC servo to operate from MSFS. I've wired up a circuit to drive it, but all it actually did was fry the first two PICs I put into it :-(Here's the circuit schematic, and the actual breadboarded circuit. Can one of you kind and brilliant electronic experts tell me what's wrong?http://forums.avsim.net/user_files/63834.gifhttp://forums.avsim.net/user_files/63835.jpgThanks for the help,Richard

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Richard, Are you sure you using right Capacitor value (C1)?? On your schematic it shows 0.1uF and from the picture of your circuity you have 0.1pF. If your chip has a low tolerate, yup that is more likely it would fry it up.

Share this post


Link to post
Share on other sites

Yes, it's right. The schematic calls for 0.1uF, and that's what I bought - the 0.1pF on the photo is a mistake.Richard

Share this post


Link to post
Share on other sites

Maybe dummy question but seems like you have nothing to reset the PIC ? After burning the program in you should reset it by putting MCLR down for a few millisecs.. Usually schemas got a capacitor from MCLR down to the ground which provides that pulse down when power is aplied to the PIC..cheers,Ben

Share this post


Link to post
Share on other sites

Richard,Is the .1uf capacitor that you are using polarized? It should be a POLARIZED capacitor. It is used for filtering noise from the supply voltage. Be sure to use a polarized cap at that loacation. You can tell if it is polarized by the markings on it. Usually one of the pins are marked either (-) or (+) and should be connected accordingly.I noticed that you have the capacitor across over the chip. Be sure that none of the leads are touching any other pins on the chip. Ideally the capacitor should be as close to pin 1 as possible, but for testing purposes, you can connect it from pin 1 to the ground bus below on your bredboard w/o going over the chip, and it should work fine. Good luck.Sean W.

Share this post


Link to post
Share on other sites

If I recall correctly, the RS-232 specs state pin voltages must be between +-25V and min +-3Vcc. If you have the +-25V kind on your PC, well....there's your problem and that's what's cooking your PICs. You need to put a MAX232 in-between your PIC and serial port.Cheers,-Leo

Share this post


Link to post
Share on other sites

Richard,The circuit you have should work. As Leo points out, treating the serial data line as it does is poor practice, but it should work. RS232C is a bipolar signal swinging typically from -8 volts to +8 volts. The RS232 spec is pretty wide and much larger voltages are "legal". This circuit puts a negative voltage on the PIC input which is out of range from the PIC point of view. What saves the PIC (maybe) is an internal protection diode and the 22K resistor. The diode tries to prevent the voltage at the PIC from going low enough to damage PIC's internal logic. The resistor limits the current to an amount manageable by the diode.Can you verify that the 22k resistor is in fact 22k? If it's too small, say 220, POOF!Are you sure the PIC has really been damaged? For instance, does it fail a read back in the programmer, and cannot be re-flashed. PICs are pretty robust. I have a couple that survived being plugged in backward. They weren't real happy, but after cooling down they flashed and ran okay.The circuit has several weaknesses that could result in flakey or non-operation. PIC's are sensitive to electrical noise on the MCLR input. It should be bypassed with a cap to ground. A .1 ufd would work well, though the actual value is not terribly critical. Noise on the power supply can also cause you grief. It won't necessarily fry the PIC but can cause erratic behavior to total non functioning. The .1 cap there now is marginal. If the servo was not connected to the same power source and the power source itself were regulated, it would be fine. Unfortunately, the servo generates electrical noise and pushes it back onto the power line. Depending on the servo model, the .1 cap may not be enough. I've had this problem with 16F628's and Tower Hobby servos. The PIC interprets negative going electrical noise as a brown-out and resets. The fix is to isolate the servo power connection from the PIC. You can experiment with passive decoupling, basically resistors and capacitors, but the easiest way to test this is simply to use separate power supplies. I finally used a 78L05 regulator for the PIC and a 7805 for the servos.Of course if you have enough noise on the PIC power supply, it WILL fry the PIC. One way to protect against that is a local regulator, like a 78L05.Mikewww.mikesflightdeck.com

Share this post


Link to post
Share on other sites

Ooops. Thanks Mike...I missed that 22K resistor in there. As soon as I saw no MAX I hit the panic button.Richard, is the Watchdog Timer (WDT) fuse set when you program your PIC? If it is and you are not clearing it in code, the PIC will constantly reboot and appear dead.-Leo

Share this post


Link to post
Share on other sites

Richard,Did you get it working? What was the problem?SW

Share this post


Link to post
Share on other sites

No, I wired a permanent one up onto a PCB in case it was a bad joint, but it still doesn't work. I adopted the above suggestion and seperated the power for the PIc from the servo power. I'm using 4xAA to drive the PIC and a transformer to power the servo's. Now, at least it no longer fries the PIC, but nor does it drive it. When I move the knob in the "ServoCommander" software, the servo 'twitches', but it doesn't move in accordance with the movement of the knob.Also, whichever of the 8 control pins on the PIC I connect to the servo's signal, moving any of the knobs makes it twitch - not just the knob for the pin its wired to.Richard

Share this post


Link to post
Share on other sites

Richard,Just out of curiosity....What version of windows are you running on your PC?Now then the Servo commander S/W.....If you are running Windows 2000 or XP, you may have trouble talking to your serial port with this program (the one I saw on the web site had a date of July, 1999 or something), as Serial port access was handle differently in older windows (95/98/ME) operating systems.Of course you may be already aware of it and have a newer version of the Servo commander S/W. Just checking. I saw this circuit sometime back and was interested in pursuing it myself, but it got put on the back burner.Sean W

Share this post


Link to post
Share on other sites

I'm running 98SE - I can't upgrade as my video editing hardware isn't compatible with anything newer :-(Richard

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this