Where might I start looking if I wanted to write an applet for communicating on an RS-485 bus?
-
-
Replying to @mdhardeman @RichFelker
This depends on what you mean by RS-485. RS-485 on paper is just a physical layer electrical standard, which Glasgow cannot correctly implement alone as it only has single-ended main I/O (LVDS port notwithstanding, but it's not protected/capable of this either)
1 reply 0 retweets 2 likes -
However, when *most* people say RS-485 they mean "RS-232 style UART over RS-485". Glasgow already has a UART applet. So assuming you mean *that*: 1) If you need "true" RS-485, you need an external transceiver, and then the UART applet needs a minor change to add a TX enable pin.
1 reply 0 retweets 2 likes -
2) if you just need to talk to "some" RS-485 device or a few in a controlled situation, you could further extend the UART applet to fake a RS-485 bus with two single-ended I/Os, assuming your grounds are common and sane, and get away without using a transceiver.
1 reply 0 retweets 3 likes -
This will work because RS-485 is usually implemented using 0V/5V single-ended signal levels, and Glasgow supports 5V logic (that's in fact the maximum supported I/O voltage).
1 reply 0 retweets 2 likes -
Replying to @marcan42 @RichFelker
I’m principally interested in interacting with / observing SIA OSDP which is implemented as a serial 2 wire RS485 multi drop bus.
2 replies 0 retweets 1 like -
Replying to @mdhardeman @RichFelker
Right, so the question is whether you're talking to one or two devices with very short cables in a controlled tabletop lab scenario (then option 2 will probably work), or whether you need to talk to an actual bus with proper termination over a longer distance (then you need 1).
1 reply 0 retweets 2 likes -
Replying to @marcan42 @RichFelker
Probably 1, for the scenarios I’d like to experiment with.
1 reply 0 retweets 1 like -
Replying to @mdhardeman @RichFelker
In that case, you need something like this: https://www.sparkfun.com/products/10124 Wiring it directly to the Glasgow pins should work, then you just need the TX enable feature. Set Glasgow to 3.3V mode and it will supply power to it, no extra hardware needed.
1 reply 0 retweets 2 likes -
Replying to @marcan42 @RichFelker
Excellent! Thanks. I see what you mean, just need to plumb through a signal pin for switching between TX and RX modes.
1 reply 0 retweets 1 like
Yup. That SparkFun breakout already hardwires TX/RX enable together, so it inhibits RX when TX is active. You just need the TX side on Glasgow to have a separate output to drive those enables.
-
-
Replying to @marcan42 @RichFelker
Looks like that IC made that easy by making one of the mode pins active low with the other mode pin active high so you could just tie the two enables to one output.
1 reply 0 retweets 1 like -
Replying to @mdhardeman @RichFelker
Yup, that was definitely part of the design. This is a standard pinout/feature, ~all RS485 transceivers do this.
0 replies 0 retweets 2 likes
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.