3
\$\begingroup\$

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.

\$\endgroup\$
  • 2
    \$\begingroup\$ Can you show the schematic \$\endgroup\$ – Iancovici Aug 15 '13 at 11:39
  • \$\begingroup\$ docs.google.com/file/d/0B684...it?usp=sharing This is the circuit of connection between PC and PIC that I have added to device and not the circuit of device. \$\endgroup\$ – PersianEngineer Aug 15 '13 at 12:09
  • \$\begingroup\$ May wana give that a second try. You might've not given the full url \$\endgroup\$ – Iancovici Aug 15 '13 at 13:03
  • \$\begingroup\$ Your link doesn't work because of the "...". \$\endgroup\$ – radagast Aug 21 '13 at 11:30
2
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

As arthur.b points out, ttl levels are not RS232 levels, and to achieve that, you need the correct tranceiver ic. That said, most modern pc motherboards recognize ttl just fine, but RS233 logic is inverted. Try inverting your ttl messages before sending them out.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.