Author Topic: RS485 transceivers and Ethernet MagJacks  (Read 5716 times)

0 Members and 1 Guest are viewing this topic.

Offline KhronXTopic starter

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: fi
    • Khron's Cave - Electronics Blog
RS485 transceivers and Ethernet MagJacks
« on: December 22, 2016, 02:56:35 pm »
I've yet to actually breadboard / prototype anything for this particular piece of my design, but i'm just wondering / throwing this out there:

Would / should RS485 transceiver chips play along well with standard transformer-isolated Ethernet / CAT5 cabling?

For the project i have in mind, i'd need to shove about 12Mbit/s of data down a twisted-pair cable, on a distance of 10-15m or so (30-50ft), in as simple and cheap a way as possible.
Galvanic isolation would be highly appreciated, hence the idea of MagJacks & CAT5 cabling.

Obviously, i'm aware i might need to play around with termination resistors, although some ballpark starting values would be nice.
Khron's Cave - Electronics - Audio - Teardowns - Mods - Repairs - Projects - Music - Rants - Shenanigans
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2867
  • Country: us
Re: RS485 transceivers and Ethernet MagJacks
« Reply #1 on: December 22, 2016, 03:20:21 pm »
Well, you lose DC by sending a signal through a transformer, so if you can encode pulse-encode your data it might sort of work, but anything that relies on longer periods at a fixed level (mark/break signals, bytes that are all 1 or all 0) you're liable to run into trouble.

Why don't you use a conventional isolated RS485 interface?  There are all-in-one isolated transceivers that will do the isolation, isolated DC-DC, and transceiving in a single wide SO package, or you can do separate digital isolator, DC-DC, and transceiver at a slightly lower cost but larger PCB footprint.  If you're only running one-to-one, you only need to isolate one side of the link. 

Although 15m isn't all THAT far that I'd be worried about isolation unless you're trying to break fault current paths or something.  As it is, RS-485 is designed for a common mode range of +12/-7V.
 

Offline KhronXTopic starter

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: fi
    • Khron's Cave - Electronics Blog
Re: RS485 transceivers and Ethernet MagJacks
« Reply #2 on: December 22, 2016, 04:19:05 pm »
Good catch  :palm:

Did a bit of digging and it turns out the protocol of the signal i intend to use (ADAT Lightpipe) actually does have a string of ten zero bits as a synchronisation sequence. Talk about throwing a wrench into the works  :-/O

https://ackspace.nl/wiki/ADAT_project

It's never as easy as it oughtta be, is it?  :rant:  :P

Well, since that's the case, i just started browsing for Ethernet IC's on Mouser. Seems quite standard for the "reference clock" to be 50MHz (either provided externally, or PLL-derived from a 25MHz crystal). I'm starting to wonder whether (or how) some might work with a lower frequency external clock...
Khron's Cave - Electronics - Audio - Teardowns - Mods - Repairs - Projects - Music - Rants - Shenanigans
 

Offline KhronXTopic starter

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: fi
    • Khron's Cave - Electronics Blog
Re: RS485 transceivers and Ethernet MagJacks
« Reply #3 on: January 25, 2017, 11:38:03 pm »
Ok, FIIIIINALLY i've got some updates... containing good news  8)

The other day, i "scored out" a little prototype board (copper-clad pcb, pencil, box-cutter knife and elbow-grease  ;D ) - no frills:
 - RS485 transceiver chip (in this case, a TI SN65LBC179A)
 - 100n 0603 bypass cap
 - 15R series input resistor
 - a BelFuse MagJack scavenged from an old 3Com network card

On the receiving end, a daughterboard from a Lenovo laptop (containing the DC-in jack, RJ45 / transformer / LAN chip) - nice and compact, and easily scope-able  :-+

Hooked up my sig-gen, set it for 6MHz, powered up the board, hooked up a 3-5m(?) CAT5 cable (couldn't be bothered to unroll & measure it), and... all is well!  ;D ;D ;D

As suspected, i might need to toy around in the prototype for the receiver end, with some termination resistors, to clean up the edges, but for a preliminary test, i'm REALLY happy  ^-^

My biggest worry was that, considering this whole system is AC-coupled (via the Ethernet magnetics), the voltage droop on a sustained succession of same-value bits (such as the string of 10 zeroes that is the sync frame in the ADAT protocol) would be too great, and as such, would make this whole idea a no-go.

Not the case  >:D I wound down the input signal all the way to 600kHz - the droop from between the start of the squarewave and its transition back to zero was a mere 0.2v (of a 2.5Vpp signal). Took it down even further, down to 200kHz - droop merely doubled, to about 0.4v. That's waaaaay more than plenty for me  :-+

Yep, this thing's starting to look pretty damn promising, if i may say so myself  ;D

EDIT: As a side-note, the driver sips about 15mA with an input of 2-600kHz, 18mA at 2MHz and up to 32mA at 6MHz.

Photo 1: an overall view of the test setup - pardon the chaos / mess  :-//
Photo 2: a closer look at the prototype transmitter and the guinea-pig "repurposed" receiver
Photo 3: scope probes hooked up to the two outputs of the transformer associated to the twisted pair i was transmitting through (1V/div, 200ns/div); sig-gen, as can be seen, set to 1MHz
« Last Edit: January 26, 2017, 12:02:06 am by KhronX »
Khron's Cave - Electronics - Audio - Teardowns - Mods - Repairs - Projects - Music - Rants - Shenanigans
 

Offline KhronXTopic starter

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: fi
    • Khron's Cave - Electronics Blog
Re: RS485 transceivers and Ethernet MagJacks
« Reply #4 on: January 26, 2017, 08:57:03 pm »
I just thought of another potential issue.

Say, the driver part of a chip has no input. that means one output will be high, and the other one low, which means a bit too much current would be flowing through the primary of the respective twisted-pair's transformer.

I was thinking of adding a DC-blocking cap in series with each TX pair's winding, but... I'm wondering how great a risk there is, of inducing some resonance / ringing  :scared:

Ethernet specs mention a minimum inductance of 350uH @ 100kHz, but that's with an 8mA DC bias (supplied via the center-tap of each primary winding). I just unsoldered one from a laptop board, and it measures at about 500-510uH @ 100kHz.
« Last Edit: January 26, 2017, 09:16:04 pm by KhronX »
Khron's Cave - Electronics - Audio - Teardowns - Mods - Repairs - Projects - Music - Rants - Shenanigans
 

Offline KhronXTopic starter

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: fi
    • Khron's Cave - Electronics Blog
Re: RS485 transceivers and Ethernet MagJacks
« Reply #5 on: January 27, 2017, 11:17:50 am »
Just for kicks, i whacked in a 100n / 100v 0603 X7R cap in series with the driver output & MagJack TX winding.

It "imbalances" the duty-cycle of the squarewave (it's no longer a symmetrical 50%), and i get some overshoot, but only on one of the transitions.
As one might expect, it gets worse with increasing frequency.

Photo 1: 6MHz input
Photo 2: 600kHz input

One thing to note is that the receiving end is terminated with whatever resistance / impedance is inside the LAN chip itself (i haven't cut the traces).
Would experimenting with (alternative) termination be worth a shot?

Khron's Cave - Electronics - Audio - Teardowns - Mods - Repairs - Projects - Music - Rants - Shenanigans
 

Offline KhronXTopic starter

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: fi
    • Khron's Cave - Electronics Blog
Re: RS485 transceivers and Ethernet MagJacks
« Reply #6 on: January 29, 2017, 11:43:11 pm »
One more step towards fulfillment  :-+

Today i decided to lift the three "output" pins of the receiving Ethernet transformer (the two ends of the winding, and the center tap), and scope the signal without those pins connected to the LAN chip on my "guinea-pig" test-receiver.

Kinda horrible-looking signal - kinda resembling what can be seen in the 6MHz photo in the previous post. Driver was sucking about 40mA @ 5v, by the way.

What the hell, let's whack a termination resistor on there, i had an 0603 100 \$\Omega\$ one. Result = damn near perfect-looking signal  ^-^ Just the sliiiiiightest hint of ringing after the transitions, but the amplitude is about as large as the trace itself is wide, on the scope display, so... I'm not gonna sweat that  :P Driver eats up just 25mA like this.

But that duty-cycle asymmetry's still there. Next week i'll get the chance to test things with a real-world ADAT signal, because i'm not 100% sure this asymmetry will affect things (but at the same time, i'm not 100% sure that it WON'T affect things either)... Ah well, time will tell :)

One thought that crossed my mind was adding another cap, between the other driver output and the Ethernet magnetics (ie. at the other end of the "primary") as well, although i'm not sure whether that would help things. Another thought was going up to a 1u cap instead of the present 100n. Thoughts?  :scared:

If that asymmetry turns out to screw with the audio after all, i guess i'll just resort to tacking on some sort of turn-on delay for the power going to the driver chip, in the final design. I've been spicing a quick-'n-dirty NPN + P-MOSFET circuit with a few passives, which should do the job well enough (to keep the driver chip from being powered before the MCU / "brain" of the audio interface this will go into finishes booting and starts outputting an ADAT signal).
« Last Edit: January 29, 2017, 11:50:11 pm by KhronX »
Khron's Cave - Electronics - Audio - Teardowns - Mods - Repairs - Projects - Music - Rants - Shenanigans
 

Offline KhronXTopic starter

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: fi
    • Khron's Cave - Electronics Blog
Re: RS485 transceivers and Ethernet MagJacks
« Reply #7 on: January 30, 2017, 06:48:47 pm »
GREAT NEWS! For myself, anyway  ;D

I finally hacked together a small prototype receiver board as well. I lifted the whole circuit-side half of the Ethernet transformer from my guinea-pig-board, and tacked on the two ends of the RX winding. I also added a Toslink-type transmitter, for later testing.

I'm very happy to report that my worries about the duty-cycle "asymmetry" turned out to be unfounded. The waveform coming out of the receive pin of the RS485 chip is as symmetrical as the input signal coming out of my sig-gen  :-+ Save for a ~50ns-ish delay, and the tiniest bit of overshoot (the receive pin's only connected to the Toslink transmitter and a scope probe).

Photo 1: prototype receiver
Photo 2: lower trace = input signal; upper trace = signal coming out of the receive pin; both 2V/div and 50ns/div
Khron's Cave - Electronics - Audio - Teardowns - Mods - Repairs - Projects - Music - Rants - Shenanigans
 

Offline KhronXTopic starter

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: fi
    • Khron's Cave - Electronics Blog
Re: RS485 transceivers and Ethernet MagJacks
« Reply #8 on: February 02, 2017, 08:30:33 pm »
Even more good news  ;D (Well, not like anyone cares anymore - in case anyone did, in the first place  :blah: )

Today i finally received my real guinea-pig... I mean, test-bed (a slightly faulty MOTU Traveler mk3 audio interface, with ADAT outs, among many others).

Photo 1: transmitter board tacked-on, straight at the ADAT output
Photo 2: an overall view of part of the system  ::)

ADAT signal goes into the transmitter board, through the grey coiled-up CAT5 (i think i noticed some "14ft" marking on it somewhere), into the "test subject" Ethernet connector & magnetics, and into a receiver board, with a Toslink-type LED transmitter on it. Then onwards via optic fiber into my main home interface (a TC StudioKonnekt 48).

Before powering it all up, i set the SK48 to get its clock / sync from the ADAT input. Upon connecting the optic cable, the "external lock" indicator greeted me with a heartwarming green colour  ;D Then after setting up some routing options, the wonderful sounds of hum induced by a finger on a 1/4" jack could be heard  :-+
Khron's Cave - Electronics - Audio - Teardowns - Mods - Repairs - Projects - Music - Rants - Shenanigans
 

Offline magetoo

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: se
Re: RS485 transceivers and Ethernet MagJacks
« Reply #9 on: February 02, 2017, 09:15:13 pm »
I for one enjoyed reading about this experiment.  Some people seem to think that this could only work with Ethernet and I wasn't sure what to believe.  Congratulations!
 

Offline KhronXTopic starter

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: fi
    • Khron's Cave - Electronics Blog
Re: RS485 transceivers and Ethernet MagJacks
« Reply #10 on: February 02, 2017, 09:17:50 pm »
In that case, i'm glad to hear that  ;D

Back at the beginning of this whole thing i figured, since RS485's a differential bus, and Ethernet's transformer-isolated... What're the odds, y'know?  :-//

But i'm reeeeeeeeeeal glad it all worked out, i can tell you that much  :-DMM  :popcorn:
Khron's Cave - Electronics - Audio - Teardowns - Mods - Repairs - Projects - Music - Rants - Shenanigans
 
The following users thanked this post: gimbal_lock


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf