Author Topic: Driving An SFP Module with Protocols Other Than Ethernet  (Read 1646 times)

0 Members and 1 Guest are viewing this topic.

Offline jamfletchTopic starter

  • Newbie
  • Posts: 4
  • Country: gb
Driving An SFP Module with Protocols Other Than Ethernet
« on: April 08, 2024, 10:49:43 am »
Hi all,

I'm trying to figure out if it's possible to use an SFP module for UART comms (or any other protocol for that matter). Judging from datasheets I've seen, such as this one : https://www.mouser.co.uk/datasheet/2/678/AVGO_S_A0003371972_1-2574527.pdf . It seems that all the SFP module is doing is just acting as a "dumb" LED driver and receiver for the optical link, and my asssumption is that you can drive this module on the TX side with whatever protocol you like (As long as the signalling format you're using has 0 DC component, due to the AC coupling internal to the module)

I've been trying to get explicit confirmation from information online that you can actually do this, but I haven't had any luck yet. I'm just wondering if anyone here has had success/knowledge about doing this?
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 4532
  • Country: au
    • send complaints here
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #1 on: April 08, 2024, 11:10:49 am »
The lowest frequency they will sustain is usually undocumented, and quite high.

UART? Almost no chance of that working. You'd need some high speed SERDES to modulate that onto the wire.
 

Offline jamfletchTopic starter

  • Newbie
  • Posts: 4
  • Country: gb
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #2 on: April 08, 2024, 11:35:12 am »
Okay thanks, so say we drive the TX pins of the module using a SERDES (or FPGA that's performing SERDES in it's logic), using 8b/10b encoding or similar, we should be able to use any protocol we like for our module right? (I.e we don't need to do any Ethernet PHY stuff)

Any idea why there's a minimum frequency? Is it to do with the impedance of the internal AC coupling capacitors?
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9023
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #3 on: April 08, 2024, 12:29:33 pm »
You can do high frequency FSK to send your UART signal, demodulating it would be as easy as low pass filtering and then envelope detection. It would make sense for something like an isolated digitizer, which needs gigabits of bandwidth in one direction but next to nothing in the other direction.
BTW, the slowest SFP modules worth buying nowadays are the 10Gb ones, they're like $2 each on Ebay and are also useful for Ethernet.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline Henrik_V

  • Regular Contributor
  • *
  • Posts: 156
  • Country: de
  • “ground” is a convenient fantasy
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #4 on: April 08, 2024, 02:14:31 pm »
Any idea why there's a minimum frequency?

ac coupled log-amplifier in the photo diode ?
Greetings from Germany
Henrik

The number you have dialed is imaginary, please turn your phone 90° and dial again!
 

Offline Echo88

  • Frequent Contributor
  • **
  • Posts: 826
  • Country: de
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #5 on: April 09, 2024, 06:46:23 pm »
I was interested in doing the same as jamfletch.
So i used these test-pcbs to explore the idea: https://osmocom.org/projects/misc-hardware/wiki/Sfp-breakout
I tested the minimum frequency when the SFP-modules would begin to transfer the waveform reliably (checked input/output frequency with scope for obvious jitter, delay and phase difference), here are the results for two SFP-modules as an example:
SFP1G-SX-85: 200kHz
UF-SM-1G-S: 180kHz
But i couldnt get UART transfer between two ESP32 to work despite using 1MBaud for example, instead both ESPs just receive random gibberish/nothing at all. Maybe the data would need to be embedded in a longer stream with CRC to reliably send/receive data?
Apart from SerDes it would also be possible to use Ethernet and a dedicated LAN->SFP bridge IC like RTL8213B.
 

Offline jbb

  • Super Contributor
  • ***
  • Posts: 1145
  • Country: nz
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #6 on: April 09, 2024, 08:13:17 pm »
I expect you need to send a signal with an equal number of 0 and 1 bits in it. This is known as a DC balanced signal.

The common 8b/10b encoding scheme could be useful here. It encodes each byte (8 bits) of data into 10 bits and provides a DC balanced output.

Edit: it may be possible to apply some encoding to UART transmissions which is both compatible with a UART and DC balanced. But you could only send a small number of bits per UART character (maybe 4??)
« Last Edit: April 09, 2024, 08:16:06 pm by jbb »
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9023
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #7 on: April 09, 2024, 11:01:23 pm »
If you're going for minimum component count, you could set up one of the microcontroller timer outputs in variable frequency, 50% duty cycle mode. (Check the datasheet, it's often listed as "toggle" mode.) Not sure if you need to provide a differential signal or if just driving one side while having the other side on a fixed bias would do. On the receive side, use a comparator (either built into the microcontroller or a separate one) to turn the differential signal to single ended and then use a microcontroller timer to measure the frequency.

I have some old 4Gb SFPs lying around that I would like to play with, I assume they're not even worth as much as the matching sockets so my best bet would be to just solder wires to the pins. (Is it correct that on the off chance I get something that expects a 4Gb SFP, I can just put in a 10Gb SFP and expect it to work?)
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline jamfletchTopic starter

  • Newbie
  • Posts: 4
  • Country: gb
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #8 on: April 10, 2024, 06:23:33 am »
And in theory, we should be fine to use 8b/10b with any protocol we want right? i.e we don't have to follow the ethernet protocol and can just signal any data we want to the TX pins of the SFP module, assuming we meet the minimum speed? My main concern is that we can get away with not using the ethernet PHY with these devices, seeing as they all advertise as Ethernet SFPs.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #9 on: April 10, 2024, 08:12:44 am »
Any idea why there's a minimum frequency? Is it to do with the impedance of the internal AC coupling capacitors?

There is usually AC coupling in the data path on both TX and RX sides.  Additionally the TX side will typically have a power control loop for the laser which compares the low pass filtered monitor photodiode current against a reference value and adjust laser bias current, with a very low data rate this control loop will be fighting the data signal. 
 

Offline Hydron

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: gb
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #10 on: April 10, 2024, 08:21:23 am »
Could you just use a Manchester code and run it fast enough to be well over the minimum frequency (a few mega baud should do it)?

I can attest to SFPs being WAY cheaper than any DC coupled optical TX/RX pair - go have a look at the prices of HFBR parts (especially the ones for glass rather than plastic fibre).
 
The following users thanked this post: jamfletch

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3392
  • Country: ua
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #11 on: April 10, 2024, 08:34:04 am »
You can wrap UART communication into UDP packets and send it over usual Ethernet IP protocol
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13750
  • Country: gb
    • Mike's Electric Stuff
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #12 on: April 10, 2024, 09:34:38 am »
SFP RS232 modules do exist, e.g. https://www.flexoptix.net/en/t-c12-rs232i.html
But I suspect internally these are ethernet to UART converters

SFPs will have minimum frequencies they can operate at - if you are wanting to use a pair of SFPs in a closed system, then  maybe you could just modulate your UART data onto a suitable carrier frequency with some fairly simple electronics.
I suspect they like a constant signal so probably FM or manchester coding rather than AM or on/off control.

Perhaps a 315MHz FM  telemetry RF transceiver chip could work ?


« Last Edit: April 10, 2024, 09:43:28 am by mikeselectricstuff »
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6266
  • Country: fi
    • My home page and email address
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #13 on: April 10, 2024, 10:43:14 am »
I can attest to SFPs being WAY cheaper than any DC coupled optical TX/RX pair
Other than S/PDIF aka Toslink, of course, which is limited in both length and bandwidth, and typically uses plastic optical cables.

(Inverted UART at higher baud rates works fine over Toslink, although I've only used the same MCU on both sides.  Whether you count it as DC coupled or not depends.)
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3727
  • Country: us
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #14 on: April 10, 2024, 01:33:19 pm »
Could you just use a Manchester code and run it fast enough to be well over the minimum frequency (a few mega baud should do it)?


This should work fine.  8b10b is more efficient, taking only 10 clocks to transmit 8 bits instead of 16 but since you are trying to run slow communications who cares.

The other thing you have to address is the idle state.  You can  either have some AC idle state, such as transmitting repeated Manchester encoded zero bytes or you can send something like the Ethernet preamble, a long repeated sequence that allows the receiver to synchronize.
 

Offline dobsonr741

  • Frequent Contributor
  • **
  • Posts: 674
  • Country: us
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #15 on: April 10, 2024, 01:54:57 pm »
I am using SFPs for SPDIF to send signal in the home theater (instead of toslink). Works like a charm. Just need to configure and enable the transmitter etc. via I2C.

It’s a fairly low frequency 6MHz-ish. Polarity does not matter, an extra bonus.
« Last Edit: April 10, 2024, 01:57:14 pm by dobsonr741 »
 

Offline jamfletchTopic starter

  • Newbie
  • Posts: 4
  • Country: gb
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #16 on: April 10, 2024, 03:05:28 pm »
 
I am using SFPs for SPDIF to send signal in the home theater (instead of toslink). Works like a charm. Just need to configure and enable the transmitter etc. via I2C.

It’s a fairly low frequency 6MHz-ish. Polarity does not matter, an extra bonus.

Out of curiosity, what SFP module are you using for this?
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16626
  • Country: us
  • DavidH
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #17 on: April 10, 2024, 10:28:16 pm »
Could you just use a Manchester code and run it fast enough to be well over the minimum frequency (a few mega baud should do it)?

This should work fine.  8b10b is more efficient, taking only 10 clocks to transmit 8 bits instead of 16 but since you are trying to run slow communications who cares.

Some UARTs support Manchester encoding directly, or at least they used to.  I think it was used for IRDA?

 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13750
  • Country: gb
    • Mike's Electric Stuff
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #18 on: April 10, 2024, 11:27:30 pm »
Could you just use a Manchester code and run it fast enough to be well over the minimum frequency (a few mega baud should do it)?

This should work fine.  8b10b is more efficient, taking only 10 clocks to transmit 8 bits instead of 16 but since you are trying to run slow communications who cares.

Some UARTs support Manchester encoding directly, or at least they used to.  I think it was used for IRDA?
No, Irda isn't manchester code - irda coding sends a either short pulse, or no  pulse at the start of each bit-cell, allowing high peak, but low avarage infrared power
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline dobsonr741

  • Frequent Contributor
  • **
  • Posts: 674
  • Country: us
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #19 on: April 10, 2024, 11:33:51 pm »
Quote
Out of curiosity, what SFP module are you using for this?

Worked with 4G Fiber Channel SPFs, later I changed them out to 1G ethernet SFP bought on FS.com

This is what I am using now: https://www.fs.com/products/48929.html

As far as connectors, I'm using a TwinGig: https://networkoutlet.com/products/cisco-twingig-converter-module
« Last Edit: April 10, 2024, 11:36:05 pm by dobsonr741 »
 
The following users thanked this post: jamfletch

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14490
  • Country: fr
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #20 on: April 11, 2024, 01:23:37 am »
And in theory, we should be fine to use 8b/10b with any protocol we want right? i.e we don't have to follow the ethernet protocol and can just signal any data we want to the TX pins of the SFP module, assuming we meet the minimum speed? My main concern is that we can get away with not using the ethernet PHY with these devices, seeing as they all advertise as Ethernet SFPs.

Yes absolutely. No problem. As said above, you should just meet the min/max rated frequency, and use some adequate line encoding scheme (8b/10b is fine, but you could use something else - 4b/5b should be fine too.)
You will need to do clock recovery, which is the "tricky" part. There are some interface ICs that can do just that (don't remember references but I think TI have some) without being Ethernet PHY.
But you could also of course use Ethernet PHYs and implement your own protocol on top of it.
 

Offline jbb

  • Super Contributor
  • ***
  • Posts: 1145
  • Country: nz
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #21 on: April 11, 2024, 02:06:42 am »
I think it's possible to - very inefficiently - use a UART to spit out signals which are properly framed (for UART receiver), DC balanced and have limited run lengths

At the very least, the following symbols could be attempted using 8 data bits, no parity, 1 stop bit:

EDIT: here's a list of 26 frames with max run length of 2. This could be divided up into 16 distinct data frames (and therefore encode 4 arbitrary bits) plus some link idle frames (bonus points if you can find a sequence that is guaranteed to get the UART receiver to synch) plus some control frame (like 'start of packet', 'end of packet')

  • 77
  • 85
  • 86
  • 89
  • 90
  • 101
  • 102
  • 105
  • 106
  • 108
  • 149
  • 150
  • 153
  • 154
  • 165
  • 166
  • 169
  • 170
  • 172
  • 178
  • 180
  • 201
  • 202
  • 204
  • 210
  • 212

It's low efficiency because you can only move 16 values -> 4 bits per frame; 40% efficiency.
« Last Edit: April 11, 2024, 02:26:35 am by jbb »
 

Offline richard.cs

  • Super Contributor
  • ***
  • Posts: 1191
  • Country: gb
  • Electronics engineer from Southampton, UK.
    • Random stuff I've built (mostly non-electronic and fairly dated).
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #22 on: April 11, 2024, 08:49:54 am »
I'm pretty sure we did something at work a few years back where we got DC equalisation on UART at low processing overhead by repeating every byte inverted, but I can't remember how we avoided DC from the start and stop bits. Obviously it's inefficient, but when the channel is wide enough it doesn't matter. Gave us some redundancy for free too.
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13750
  • Country: gb
    • Mike's Electric Stuff
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #23 on: April 11, 2024, 09:30:27 am »
I'm pretty sure we did something at work a few years back where we got DC equalisation on UART at low processing overhead by repeating every byte inverted, but I can't remember how we avoided DC from the start and stop bits. Obviously it's inefficient, but when the channel is wide enough it doesn't matter. Gave us some redundancy for free too.

As long as you're sending continuously with no gaps, the start and stop bits will cancel each other out
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline richard.cs

  • Super Contributor
  • ***
  • Posts: 1191
  • Country: gb
  • Electronics engineer from Southampton, UK.
    • Random stuff I've built (mostly non-electronic and fairly dated).
Re: Driving An SFP Module with Protocols Other Than Ethernet
« Reply #24 on: April 11, 2024, 10:25:26 am »
As long as you're sending continuously with no gaps, the start and stop bits will cancel each other out
I guess that was probably it. We did send a big block of data with a fairly long preamble before it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf