Jump to content
Sterny

Questions on SFP transceivers in hobbyist projects.

Recommended Posts

I work in the storage industry, and my shop has a large amount of Fibre Channel and Gigabit Ethernet SFPs that are getting replaced and many are getting scrapped.  I was working in the lab today and started wondering if any could be adapted in someway to get a couple MCU dev boards talking.

 

I did manage to find a datasheet after some quick googling - http://www.avagotech.com/docs/AV02-0671EN

 

So it's clear to me that at my particular stage in learning, interfacing with the board is beyond my capability.  But as I continue my education, I think at some point I'd like to take a stab at it.

 

I was wondering:

 

1.  Have you come across any projects or libraries which attempt to interface older SFPs with more modern MCU dev boards?

 

2.  What are your general thoughts about this?  Is this a fools errand? I understand it's not very practical, but I thought it would be pretty cool to get two MCUs talking to each other and being able to dig deep in how it's actually accomplished.  

 

Working in the data storage industry, I'm used to looking at FC analyzer traces and working problems within the protocol, and dump data from the end device products.  But as I get more and more into the actual electronics involved, I start trying to come up with different avenues of exploration.

 

Thanks for reading!

 

Regards,

Sterny

Share this post


Link to post
Share on other sites

Hi @@Sterny,

 

In my opinion, this is not a fool's errand. Just keep this in mind. You can use SFP modules wherever you might use an optocoupler.

 

 

I personally have integrated SFPs into a large scale data recorder system for the seismic industry. I had to attached them to large FPGAs.  The interface between the SFP module and the FPGA was a high speed LVDS bus that operated in the 3V range. 

 

Additionally, there is an I2C interface on every SFP module. It's the Digital Diagnostic Interface and programming port. You can get a ton of data out of it. Check out a document called SFF-8472 for more details.

 

I have no doubt that you could get them to run between two MSP430s using a low speed data link. You would have to design an LVDS interface circuit but that shouldn't be too hard. 

 

There is a typical application schematic on page 5 of that datasheet you referenced. You can implement most of that and it ought to work.

 

The protocol between the two SFP modules would take some thought. Typically, there is a heartbeat signal transmitted on the fiber to tell both ends that the link is still up.

 

Also, the protocol is usually 8B10B encoded. This prevents too many 1s or 0s from being transmitted in a row. The receiving end can lose sync if a large number of 1s or 0s are transmitted. I would be inclined to try out the hardware with no concern for 8B10B encoding because the data rate of an MSP430 will never get close enough to cause problems. If, after the tests, data is dropped then I would implement the encoding protocol.

 

 

I really want to design and to create a full duplex fiber optic talk set using SFP modules. I'm working on this idea in my spare time so that isn't a lot of time typically. These days, I do more teaching about SFPs than I do using them. My company teaches people how to work with fiber optics and I am the chief instructor.

 

Whatever you do, just remember that you're doing it for fun! :-)

 

 

Share this post


Link to post
Share on other sites

HI @@zeke,

 

Thank you very much for your reply.  Your insight and suggestions are incredibly helpful to me.

 

I'm actually familiar with 8B10B encoding and running disparities.  Years ago, I attended some training from Medusa Labs, that provided instruction on fibre channel using Finisar's x-gig analyzers (whom was bought by JDSU a few years ago).  Although at that time, I really had no previous exposure to the engineering side.  And then recently, after getting into MCUs, and studying UARTs and RS232 signaling, I had an ah-ha moment.

 

 Probably apparent to most on this forum, but the realization I had was the 8B10B encoding allowed for getting away from the stop bit in UART communications.  I kind of took a backwards approach to this, as I'd imagine most study the generic serial encoding first.  But in my case, coming into the hobbyist electronics part of it after studying FC in the scope of my day job, getting a bit more lower level understanding on why such things are done is extremely fascinating and interesting to me.

 

I'm also fortunate in that if I'm able to make any traction with this project, I have access to $125k X-gig instrumentation at work - it makes me giddy to think one day I might be able to trace the link, while also attaching logic analyzers to the MCUs and be able to affect the behavior in code.

 

I had another question I'm hoping you might be able to provide direction on.

 

As you noted, I put a link to a SFP  datasheet in my original post.  But the SFP vendors I have access to at work are typically branded by Cisco, Finisar, or Brocade.  If I do a search for datasheets on those parts, I'll typically get back the 'marketing' datasheets from the vendors that really have no useful information on how to interface with them.

 

Do you have any guidance on the best place to get datasheets by simply looking at their labels?  I imagine these SFPs are OEM'd from a few different companies, but I'm struggling on how to best identify them and also how to best locate the actual datasheet necessary to interface with them.

 

BTW, your project design sounds really interesting.  I'm left to wonder what it would take to design and implement the physical connectors and LVDS interface on a breakout board.  A quick search on eBay shows someone selling qty 30 Cisco 4Gbit SFPs for $30 - at a dollar a piece, I'd have to think playing with this stuff would be appealing to others and still be able to maintain a hobbyist price point.

 

Thanks again for help!

 

Regards,

Sterny

Share this post


Link to post
Share on other sites

@@Sterny,

 

 

 

I did a lot of work with SFPs from COTSworks. They take SFPs from other vendors and ruggedize them for aeronautics, military and industrial applications. There's no one else that I know of that does this.  That said, I chose to use their SFF-2G-SX-DPLX-LC-R-A SFP module. The datasheet is right there on the page.

 

Additionally, I studied everything I could on LVDS, PECL, and other differential signalling standards. Here's a couple of links:

I bring up the above links because you will soon discover that the differential interface is not the same between all SFPs. Some are LVDS, others are PECL and others something else weird.  It's a small detail that is only discovered after you bought a few samples that you can't use >:-(

 

I faced the above challenge because I ended up using SFF modules which are not exactly the same as SFP modules. An SFF has pins and solders into a pcb.

 

Here's an excellent summary of SFP characteristics.

 

The SFP manufacturer that I turn to first is always Finisar. In my world, they are the largest manufacturer of SFPs. I would bet money that Cisco and JDSU get theirs made by Finisar.  I know that COTSworks sometimes ruggedizes a particular Finisar module when their customer requests it.

 

Here's how I classify SFP modules:

- Glass:  Singlemode or Multimode?

- Colour:  1310/1550 nm vs 850/1300 nm?

- Data rate: OC1/3/12/24/48/192/768 ?

- Distance: practically infinite (SM) vs 2000/550/220m (MM)

- Cost: SM is usually two to four times the cost of MM electronics

 

 

For fun, here are a couple of videos on fiber optics that I think are fantastic:

 

Back to circuitry...

 

Here is the Finisar FTLX1371D3BCL transceiver datasheet.  It is stuffed with plenty of details that will help you design an interface for it. Look on page 10. There's your basic interface. There are two sections: Signalling and Control.

 

The Control interface is power, I/O and I2C. All low speed stuff.

 

The Signalling interface is filtered power, RX and TX. 

 

You have to translate your single ended signal into an LVDS differential signal. You could make use of an SN65LVDS050-Q1 since it contains two RX/TX pairs. 

 

Keep this app note from TI on LVDS Interface circuits.

 

I hope this helps to get the ball rolling.

Share this post


Link to post
Share on other sites

@@zeke,

 

Thank you again.  I cannot express in a forum post how grateful and appreciative I am for you taking the time to point me in the right direction on how to begin my research on this project.  Awesome!!

 

@@spirilis,

 

Wow, after reading a lot of your posts, I had always assumed you were a design engineer at your day job.  Or, do you do storage admin work in addition to engineering there?

 

I noticed that you've designed some boosterpack boards - based on the information @@zeke provided, how big of a lift would a SFP booster pack be?  I'm just curious about some context from someone who has actually gone through that process.

 

Regards,

Sterny.

Share this post


Link to post
Share on other sites

@@spirilis,

 

Wow, after reading a lot of your posts, I had always assumed you were a design engineer at your day job.  Or, do you do storage admin work in addition to engineering there?

 

I noticed that you've designed some boosterpack boards - based on the information @@zeke provided, how big of a lift would a SFP booster pack be?  I'm just curious about some context from someone who has actually gone through that process.

 

Regards,

Sterny.

 

Lol, I don't do any design engineering at work, I am only a storage & backup admin :D

This is all a hobby (one I haven't spent much time on this past 12 months but hopefully that'll change in a bit)

 

As for SFPs .... I bet it would be doable but as @@zeke mentions, you would want to research and play with the LVDS interface stuff first.  Eventually coming up with an LVDS solution that works with the 3.3V MCUs, you could conceivably produce a "boosterpack" around it.  Definitely one of the more esoteric forms of MCU-MCU communication I've heard of.... but as you just said (much to my own amazement), almost $1/pc for 4Gbps SFPs!  Dayum.

Share this post


Link to post
Share on other sites

@@spirilis,

 

Heh - yeah, SFP Boosterpack's - for when you need to talk to a MCU 300 meters away!  :)

 

I guess though, maybe one practical application would be a SFP tester, or maybe even a cable tester.  But of course there are many products already out there that do that.

 

For me though, it's the journey I'm interested in, and as this technology is related to what I do for living, dipping my toe in a bit deeper couldn't hurt.  Plus, this type of media is where everything is at when it comes to device to device connectivity.  Copper throughput and distance limitations are pretty prohibitive unless you're attaching to the top of the rack.  

 

v2 will support QSFP's.  ;)

 

Thanks again for all the response.

 

-Sterny

Share this post


Link to post
Share on other sites

@@Sterny,

 

Please keep in mind that one of the most important things about LVDS circuit designs is the PCB trace impedance.  

 

The layout of the LVDS bus has got to follow the rules or else you may get an impedance mismatch. That will cause signal reflection, ground bounce and other spurious radiated and conducted emissions. 

 

The Altera datasheet link above goes into depth on this topic. I think the TI Analog Interface pdf talks about this too.

 

Let me know what you end up deciding. You just might motivate me to get started on my design :-)

Share this post


Link to post
Share on other sites

Hi @@zeke,

 

Wow, I think it would be fantastic if considered starting up your project.  The fact that you have already implemented similar tech previously makes me think this could actually come to fruition.

 

I don't have any experience working with designing boards.  I do understand there are some board house services where you can submit designs and get relatively fast and quality service at a pretty low price (e.g dirtypcbs.com, et al,).  But I'm a quite a ways off in my learning to even approach something at the complexity you mention.  Learning the software tools (Eagle, etc) is definitely something I want to explore in the near future though.

 

My initial though was to try to prototype something with a breadboard or perfboard - but since you mention there are a lot of impedance considerations, I'm thinking that might present some problems, as I understand breadboards are fraught with impedance issues.

 

It does seem to me that based on your role in actually teaching this stuff, such a 'boosterpack/shield' type of kit would also have some uses in education related to what you do for a living.

 

I'd certainly be willing to contribute with some of the material costs that would go into such a project.  If only to be able to get a first row seat in learning how something such as this goes from a concept into an actual board that can be attached to a MCU.

 

Best regards,

Sterny

Share this post


Link to post
Share on other sites

Lol... Decided to take another look at this thread, as my boss and I were chatting about how many (potentially bad) SFPs we have laying around the office.

 

So if I'm not mistaken, the SFP has an LVDS interface for the TX and RX side, and you just need an LVDS interface - something like http://www.ti.com/product/ds90lv011a (TX) and http://www.ti.com/product/ds90lv012a (RX) for example (a 400Mbps PHY available for ~$1 at mouser in single qty) - and boom, an LVDS interface you make?

 

Per https://en.wikipedia.org/wiki/Small_form-factor_pluggable_transceiver - there are lines to disable TX, sense if TX is faulty, and sense if there is no optical RX present.  Sounds simple enough?  Does the transceiver not really give two craps about the speed of the LVDS PHY except for obvious issues that can emerge when you push it to its upper speed limits?  So you could just route the LVDS TTL in/out to the UART, and speak high speed UART over fiber?

(High-speed differential traces of course respected for the LVDS stuff... luckily my favorite PCB CAD software, DipTrace, now has differential pair management in v3.0+)

 

Also to make a hobby board out of this I'd need a suitable edge connector for the SFP's.  Unless SFF's are available cheap...

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Looking up the datasheet for some of the SFP's I have laying around (potentially bad)-

 

https://www.finisar.com/sites/default/files/downloads/finisar_ftlf8524p2xny_4.25gbs_rohs_compliant_short-wavelength_sfp_transceiver_product_specification_1.pdf

 

Finisar FTLF8524P2BNV (from a 4Gbps Brocade ED-48000 fiberchannel switch)

 

post-15991-0-64244600-1469559121_thumb.png

 

Sounds like there are different speed-related modes that are switchable via I2C (OR a GPIO toggle) but there is no "Min" in the bitrate...

Share this post


Link to post
Share on other sites

@@spirilis

 

Wow, how exciting it is that you decided to resurrect this thread.

 

I had a quick look at your links.  So along with TI LVD driver chip, and the PHY you linked, is it essentially routing the control and signaling to some GPIOs on a launchpad MCU?  And with that, you'd be able to drive the SFP?

Share this post


Link to post
Share on other sites

@@spirilis

 

Wow, how exciting it is that you decided to resurrect this thread.

 

I had a quick look at your links. So along with TI LVD driver chip, and the PHY you linked, is it essentially routing the control and signaling to some GPIOs on a launchpad MCU? And with that, you'd be able to drive the SFP?

I'd like to hear if @@zeke has any input on that but from what I've gathered so far that sounds right. Unless there is in fact a caveat regarding minimum bitrate through the laser, in which case that would confound things.

 

edit: Zeke did say he thinks an MSP430 could interface with it using a low speed link. So that's probably confirmation enough.

Share this post


Link to post
Share on other sites

Yes, I am glad someone resurrected this topic. I fell into a black hole of busyness after I posted my replies.

 

If I were to tackle this hardware design myself, I would:

- pick the serial port

- configure it for 1Mbps

- attach LVDS drivers and receivers to the TX and RX pins

- connect those LVDS ports to the SFP cage

- connect the I2C port to the SFP module's diag port

- write a device driver for the SFP module which uses a state machine to keep track of flags and packets and stuff

- write a test program that does local and remote loopback.

- write a test program that acts like a serial port bridge

 

If the serial port talks too slowly then I would find a faster two wire serial peripheral and repurpose it. How about that serial audio interface port? It's pretty fast. I might have to create a circuit to regenerate the clock signal from the optical signal but that's not uncommon.

 

I'm just thinking out loud.

Share this post


Link to post
Share on other sites

Yes, I am glad someone resurrected this topic. I fell into a black hole of busyness after I posted my replies.

 

If I were to tackle this hardware design myself, I would:

- pick the serial port

- configure it for 1Mbps

- attach LVDS drivers and receivers to the TX and RX pins

- connect those LVDS ports to the SFP cage

- connect the I2C port to the SFP module's diag port

- write a device driver for the SFP module which uses a state machine to keep track of flags and packets and stuff

- write a test program that does local and remote loopback.

- write a test program that acts like a serial port bridge

 

If the serial port talks too slowly then I would find a faster two wire serial peripheral and repurpose it. How about that serial audio interface port? It's pretty fast. I might have to create a circuit to regenerate the clock signal from the optical signal but that's not uncommon.

 

I'm just thinking out loud.

Yeah fwiw, I am probably not getting to this until Sept or Oct at the earliest, for now I've produced the PCB footprints & schematic components I need so that's ready... but in the meantime I have a GPS boosterpack and a CC1310 board (both PCBs shipped and on their way from China) to work on soon :-D

 

This might be on the back burner but at least the project's scope has been mapped out.  I would like to do it for kicks.  I am going to implement a current monitor on the VccR and VccT rails too for the SFP for my own curiosity's sake - could double as an SFP "tester" of sorts.  My current thought is to use something like an INA138, high-side current sense amplifier, buffered by an LMV358 (dual opamp) and routed to two of the ADC pins - or observed using my new oscilloscope.

Share this post


Link to post
Share on other sites

Yeah fwiw, I am probably not getting to this until Sept or Oct at the earliest, for now I've produced the PCB footprints & schematic components I need so that's ready... but in the meantime I have a GPS boosterpack and a CC1310 board (both PCBs shipped and on their way from China) to work on soon :-D

 

This might be on the back burner but at least the project's scope has been mapped out.  I would like to do it for kicks.  I am going to implement a current monitor on the VccR and VccT rails too for the SFP for my own curiosity's sake - could double as an SFP "tester" of sorts.  My current thought is to use something like an INA138, high-side current sense amplifier, buffered by an LMV358 (dual opamp) and routed to two of the ADC pins - or observed using my new oscilloscope.

Sounds like you need a better 'round-to-it' implementation ;)

Share this post


Link to post
Share on other sites

This is a very interesting topic for me. I am planning for an application where I need to connect to MCUs over long distance (around 10km and more) using OFC. The data rate I need is below 2M bits /sec. 
 
My concern is the following---- Will the SFP module work at this low frequency? I was planning along the way 
 

Yes, I am glad someone resurrected this topic. I fell into a black hole of busyness after I posted my replies.

If I were to tackle this hardware design myself, I would:
- pick the serial port
- configure it for 1Mbps
- attach LVDS drivers and receivers to the TX and RX pins
- connect those LVDS ports to the SFP cage
- connect the I2C port to the SFP module's diag port
- write a device driver for the SFP module which uses a state machine to keep track of flags and packets and stuff
- write a test program that does local and remote loopback.
- write a test program that acts like a serial port bridge

If the serial port talks too slowly then I would find a faster two wire serial peripheral and repurpose it. How about that serial audio interface port? It's pretty fast. I might have to create a circuit to regenerate the clock signal from the optical signal but that's not uncommon.

I'm just thinking out loud.

 
 Also, the module I am looking at (TL-SM321A) mentions specific protocol( IEEE 802.3z, CSMA/CD, TCP/IP) . Will I be able to use it for serial data? 

 

@@zeke  Since you have experience connecting FPGAs with SFP, what kind of data rate you designed the system for and did you implement any specific protocol?

 

Best regards

Share this post


Link to post
Share on other sites

The FPGA expert on our team took care of the VHDL programming while I designed the electronics.

 

Our first version had a data rate of 640Mbps. The second version had a data rate of 1.2Gbps.

 

At those speeds, the custom protocol needed to be enhanced with an 8b10b encoder in the VHDL code. That would enhance data reception by preventing excessive consecutive zero bits. The receiver would see nothing with many zeros because the light is off during a zero bit.

 

It is my assumption that a 2Mbps data rate is slow enough that the 8b10b encoder would be overkill.

 

Oh, the SFP modules have a speed rating. Get the ones that are rated for OC-3 or 155Mbps. The next speed option is OC-12 or 640Mbps. Also, make sure the SFP electrical interface is LVDS and not PECL.

 

The key for getting my proposed interface working would be a software routine that would send a repetitive keep alive message on the optical link. The receivers need to stay in sync with each other. So just send a tick-tock message at a regular interval to keep the link up and the receivers synchronized.

 

Thanks for keeping this thread alive. I keep forgetting to act on this design. I can see this hardware design working well because it is simple. It now looks like a software challenge to me.

Share this post


Link to post
Share on other sites

 Also, the module I am looking at (TL-SM321A) mentions specific protocol( IEEE 802.3z, CSMA/CD, TCP/IP) . Will I be able to use it for serial data? 

 

@@zeke  Since you have experience connecting FPGAs with SFP, what kind of data rate you designed the system for and did you implement any specific protocol?

 

I'm looking at the specs on the TL-SM321A and the first thing that pops out at me is that it operates on two different wavelengths - RX=1310nm and TX=1550nm.  

 

That tells me that it should have a matching SFP module and sure enough it does have a mate. It's the TL-321B where RX=1550nm and TX=1310nm.

 

I also noticed that it's a BiDi SFP module. That is, it transmits and receives on one strand of glass. That's cool but it makes the module more expensive and exotic.

 

When I think about needing 10km of fiber, I am not going to install only one strand of glass. I'm going to install as many as I can for the same cost.

 

So, that means that I can use a traditional duplex SFP module and I know that module will be less expensive and more common than a BiDi module.

 

If you can, try to optimize your system design to use a traditional SFP module. This means install a fiber cable with lots of fibers.

 

If, for some reason, you are compelled to use a single strand of glass (i.e.: financial reasons) then, of course, use a BiDi module. Just get a module that transmits and receives on the same wavelength if possible. 

 

 

Here's a list of specs I will be choosing for my project:

  1. TX = 1310nm
  2. RX = 1310nm
  3. SFP form factor
  4. Up to 155Mbps bi-directional
  5. Built in diagnostics
  6. Duplex LC connector
  7. Metal enclosure
  8. Single 3.3V power requirement
  9. Industrial temperature range [-40..85]'C 

I searched the Finisar website and came up with the FTLF1323P1xTR which fits the bill.

 

And, it looks like Digikey carries the FTLF1323P1BTR for a princely sum of $58.91 in single lot quantities.  That's a decent and respectable price for a singlemode module.

 

The nice thing about this module is the speed and the power ratings. You can run this slower than 155Mbps and its electrical side should slew just fine. Also, the TX power and RX sensitivity ratings are compatible which means that you can plug in an optical loopback cable and not overload (damage) the receiver. This means that testing the unit will be easier.

 

 

By the way, I regularly teach fiber optics courses (see www.ninemicron.com) and if you like I could put together a brief tutorial on how to design a fiber system from an Electrical Engineering point of view.

 

Just let me know.

Share this post


Link to post
Share on other sites

Yeah I haven't done anything with this yet either.  I did buy some SFP cages and SMD SFP connectors though.  Perhaps next year...

 

 

Oh!  

 

<fires up Altium>

 

I guess that means that there's a chance that I could beat you to the punch then!

 

;-)

Share this post


Link to post
Share on other sites

@@zeke,  Thank you for your input. For now I am planning to go with your suggestion of using traditional SFP module. I guess if I want to use BiDi module in future, its just the matter of replacing the module.

 

Thank you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×