Electronic – How to remove Noise/Voltage in TX pin of PIC16F877

microcontrollernoisepicrs232usart

I wanna connect an existing device to PC using RS485/RS232. I have programmed the microcontroller correctly and it works when I haven't switch on the power of device. I mean after programming by PIC kit 2, I have tested it by connecting the related cable from TX pin to PC and have received the test messages of microcontroller by hyperterminal. but when I turn on the device I can not receive. I tested the output voltage of the TX pin, It shows 4.3v voltage. I used 1k pull-down resistor in this pin. the voltage removed but still I can not receive any message.

Suddenly one day, after programming the microcontroller and without disconnecting the in-circuit programming cable, I saw that the device is sending message. after checking all pins of PICKIt 2 programmer, I saw the pin GND of programmer is affecting the device and removes the voltage in pin Tx. I mean if I connect the GND pin of microcontroller to an external GND, It sends correctly the message but sometimes with a bit changes in some characters randomly like a noise.

briefly, there is a noise in Pin Tx of PIC microcontroller. How can I remove this noise when the device is connected to mains. I should mention that this device has some parallel boards: power supply board, MCU board and IO boards beside each other. the power supply board is very close to MCU board which including out microcontroller (around 2cm).

Should I use a bigger pull down resistor? Should I use capacitor in parallel with pull down resistor? which capacitor?
Please guide me. I'm a EEE student working on a summer project.
I appreciate a lot in advance.

Best Answer

If you want to use RS232 you have to respect the voltage level specified by the protocol, if not you are just sending asynchronous serial data in TTL levels.

To convert the signal level to the spec you can use an IC like the old MAX232 , that should be easy to get.