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.

Serial Port

Status
Not open for further replies.

YAN-1

New Member
Hello everyone. I have constructed a configuration in which a PIC 16F877A communicates with a PC using RS232 protocol. I am using a MAX232 IC of course and have set both ends to the same baud rate and have set the PIC to operate in interrupt mode. The PC could either send the PIC data or receive feedback from it and it is all done through the interrupt service routine. Now this arrangement has been working just fine and it is all installed on top of a car. But recently, some weird things are happening. When the car is turned on, the communication suddenly gets slow and bytes are no longer sent from the PIC to the PC. The vibrations on the car are considerable, but do they really produce this much noise or something? I made sure that there are no loose connections or anything. As soon as the car is switched off, everything goes back to normal.

The computer takes its power from an inverter which draws its input DC from the car batteries. Could there be spikes resulting from the running engine of the car resulting in distortion of data? The same thing happens with other devices on the car involving serial ports, where the values start jumping around when the car is turned on. This didn't happen before, and I have capacitors on the power of the PIC board and the MAX, but recently my car batteries are getting weaker and aren't charging properly. Do you think the problem is with clean power rather than the vibrations themselves? I intend to get new batteries. Your advice and recommendations are much appreciated.

Thanks a lot.
 
RS232 RX/TX Shares common ground, so it is possible that noise could come from you computer. If you are positive about that there are no other leakages to the chasi other than the computer power connection, this could be a likely source.

I'm not sure if this works, but you could try to decouple the ground line with a decoupling capacitor...

Have you tried with the computer connected to the mains while the car is running?
 
Car electrics are really noisy.

You say that the battery is weak and this problem has started recently. I think your alternator is faulty or the battery needs changing. Either would cause voltage dips, which are too long for capacitors to carry the circuit over.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top