RS-485 Transciever as differential line driver for PWM signal? - Page 1
Forum section: electronics / projects

author: max_torque
author_rank: Super Contributor
timestamp: February 01, 2020, 07:42:25 pm
content: I have an application master device that will "communicate" with a basic remote slave device, either using a raw PWM signal at a fixed fundamental frequency, or for the "smarter" slaves, using RS-485.It strikes me that i might be able to use an RS-485 transciever to cover both requirements? Connect a suitable TTL PWM signal to the TX input pin of the transciever, assert the driver enable pin, and modulate. With some carefulpin routing, i can connect the transceiver both to the UART and a PWM periferal of the control micro.Anyone done this before? Any reason it won't work? (some transcievers may have pulse width limits outside of which they go "off bus" to avoid a rogue unit taking down an entire bus, but i don't think that applies to the most RS-485 parts ie MAX485 etc) Master and slave share the same ground potential, so unbalanced (different high to low durations) signals shouldn't cause an issue.The application master could even poll for a Serial slave first, and if it doesn't get a reply, then it can swap to raw PWM mode etc.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 01, 2020, 08:00:51 pm
content: Well, RS-485 has no care about low frequency content, or DC balance. There's good reason it's not transformer coupled.Absolutely, is fine. No DC or clock limitations, they're asynchronous and dumb, literally just special-purpose buffers.Also great for sending SPI over greater distances, for another example. Trivial, just plop the rx/tx in front of the transmission lines and you're off. RS-422 (always-on transmitters) more than 485 (keyed transmit) in that case.As you note, extreme values can run into minimum pulse width limitations, and PWM accuracy in general is subject to t_PLH / t_PHL and t_r / t_f skew and variations. This is good reason to choose a relatively low carrier frequency, if accuracy is required. You may bias (offset + gain) the source, so that it avoids extreme low or high duty. That's about it!Note that these limits proscribe the available bandwidth-accuracy of the channel. For example, a carrier of 5kHz, at 12 bits ENOB, needs a total skew drift/error better than ~50ns. To do better, consider another encoding instead, like serial bytes/words encoding the duty (assuming a digital source) and feeding a counter or DAC at the far end to reconstruct the PWM or baseband signal.Tim

author: David Hess
author_rank: Super Contributor
timestamp: February 03, 2020, 12:34:52 am
content: RS-485 works fine for sending PWM.Quote from: T3sl4co1l on February 01, 2020, 08:00:51 pmAdd an RS-485 receiver on the transmit side to monitor the output signal and use a feedback loop to control the PWM duty cycle. Now accuracy is limited by the matching of two receivers.

author: langwadt
author_rank: Super Contributor
timestamp: February 03, 2020, 12:41:56 am
content: Quote from: David Hess on February 03, 2020, 12:34:52 amdon't think I've ever seen a RS-485 transmitter, all I've seen is RS-485 transceivers

author: David Hess
author_rank: Super Contributor
timestamp: February 03, 2020, 03:21:50 am
content: Quote from: langwadt on February 03, 2020, 12:41:56 amLook through the interface section of old databooks. If necessary, a transmitter is just a transceiver wired one way.

author: oPossum
author_rank: Super Contributor
timestamp: February 03, 2020, 06:51:30 pm
content: 26LS31 and 26LS32 are the classic differential line driver/receiver. Were used in all kinds of stuff for decades. There are numerous newer pin compatible chips.