Author Topic: RS-485 Transciever as differential line driver for PWM signal?  (Read 1515 times)

0 Members and 1 Guest are viewing this topic.

Offline max_torqueTopic starter

  • Super Contributor
  • ***
  • Posts: 1325
  • Country: gb
    • bitdynamics
RS-485 Transciever as differential line driver for PWM signal?
« on: February 01, 2020, 07:42:25 pm »
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.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22433
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: RS-485 Transciever as differential line driver for PWM signal?
« Reply #1 on: February 01, 2020, 08:00:51 pm »
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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17167
  • Country: us
  • DavidH
Re: RS-485 Transciever as differential line driver for PWM signal?
« Reply #2 on: February 03, 2020, 12:34:52 am »
RS-485 works fine for sending PWM.

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.

Add 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.
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4751
  • Country: dk
Re: RS-485 Transciever as differential line driver for PWM signal?
« Reply #3 on: February 03, 2020, 12:41:56 am »
RS-485 works fine for sending PWM.

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.

Add 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.

don't think I've ever seen a RS-485 transmitter, all I've seen is RS-485 transceivers   

 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17167
  • Country: us
  • DavidH
Re: RS-485 Transciever as differential line driver for PWM signal?
« Reply #4 on: February 03, 2020, 03:21:50 am »
don't think I've ever seen a RS-485 transmitter, all I've seen is RS-485 transceivers

Look through the interface section of old databooks.  If necessary, a transmitter is just a transceiver wired one way.
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1448
  • Country: us
  • Very dangerous - may attack at any time
Re: RS-485 Transciever as differential line driver for PWM signal?
« Reply #5 on: February 03, 2020, 06:51:30 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf