connection of PC rs232 with rs485 network

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I want connect PC with RS485 network. I use COM1 of PC connected to an MAX232 and follow an MAX483. I use for the transmition of signals the visual basic 6, MSComm control.

Via rs485 network I collect those signals to an mega8.

I control manually the direction of MAX483 in pc side (marked with A in attached file), and is possible to send a receive data from PC to mega8 without problem.

The problem is how can I control the direction of MAX483 in pc side via COM1, automatically? I want when I send a stream from PC, to be set the MAX483 in transmition mode, and immediately after the transmition of the stream to return back in receive mode.

any idea?

Attachment(s): 

Learn as long as you live

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could use the RTS line to control the transceiver.

It will be difficult to control it accurately, PC UARTs don't have an interrupt that tells you the shift register is empty, like AVRs can. But I guess there are ways around that.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can leave the receive channel enabled in the RS485 transceiver as long as you can tolerate the echo (which actually helps to detect collisions). Then, use the RTS to control the transmit enable.

BUT, BUT, BUT,

You CANNOT just connect a MAX485 to a MAX232 because the MAX232 (or any real RS232 channel) is NOT standard logic level, which the 485 transceiver expects.

Also, the logic sense will be messed up between the AVR and the PC unless you swap the A & B lines. This is due to the inversion already added by the MAX232.

I suggest that you get a RS232/RS485 converter box from somebody like BlackBox.

By the way, this post has nothing to do with gcc!

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also, if you use a FTDI FT232 usb->serial device, it can control the rs485 direction for you without any specific software intervention.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you all guys, finally I made an RS232/RS485 converter according to this site:

http://www.airborn.com.au/layout...

It works.

Jim, I develop the software of mega8 with AvrGcc so I mistake and I post my question in AVRGCC forum. I am sorry for that, I hope someone moderator can move my question in most related forum.

Learn as long as you live

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We have been using the no-micro RS485-USB converter using FT232xy right from the datasheet with no problems.

B&B has some auto-switching RS485 converters and they work OK but not as well as the FT232 solution.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
It works.
Did you read the warning at the top of the page?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I red it. I communicate at 9600, and I still not have any problem with the communication, but I worry a litle bit.
Does any body has a better idea on how to communicate PC-COM1 with peripheral devices on a rs485 network?

Learn as long as you live

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is how I do it (serial-rs485) with a home-brew solution.

http://pwillard.com/?p=60