Dear friends,
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).
Please notice that the programming doesn't have any problem and the connection circuit as well as following:
**broken link removed**
This is the circuit of connection between PC and PIC that I have added to device and not the circuit of device.
Should I use a bigger pull down resistor? Should I use capacitor in parallel with pull down resistor? which capacitor?
Why when I connect an external GND source to Vss of PIC, the noise reduces a lot and I can receive the messages but not perfectly? what is the role of external GND here?
Please guide me. I'm a EEE student working on a summer project.
I appreciate a lot in advance.