Optical Serial Interface

Discussion in 'The Projects Forum' started by Art, Apr 23, 2016.

  1. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    Hi Guys :)
    I have a pic micro connected with it’s UART to a FTDI USB adapter, and that’s working nicely.
    Now I’d like to use an optical interface, the first of which I’ve tried is Toslink.
    I salvaged the Toslink receiver from a converter box that converts SPDIF optical to a coax cable.
    It seems to output identical signal as the input signal from an LED, even when the LED is connected
    to serial the output looks ok, but the serial inout to the chip is garbage.
    There was a ceramic capacitor in series with the optic receiver’s output in it’s original application,
    which I didn’t use because 2400 baud should still look like a DC signal.
    The original application, the signal was buffered with a 7404 (after the capacitor).

    Has anyone tried this?
    Cheers, Art.
     
  2. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,801
    1,105
    The cap may have been there to eliminate a DC bias. Try putting it back in and see if you get the signal you expect.
     
  3. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    Hi Alec :) It looks like it will be ok now.
    I had some lunch connecting a 0.1uF cap across the receiver output and gnu,
    and also the voltage driving the LED had to be lowered.
    Still not perfect, but more characters are making it than not.
     
  4. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,801
    1,105
    Eh?
     
  5. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    Yes it was about 3am here when I got it working properly :D
    There's still no cap in series with the signal from the receiver.
    It works reliably with 0.2uF capacitance between the signal and ground.
     
  6. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,801
    1,105
    A somewhat surprising solution, but hey, if it works it works :). Perhaps the cap shunts high frequency noise to ground without unduly affecting the wanted signal?
     
    Art likes this.
  7. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    I had another play with it today. Now the signal output is fed directly into two inverters of a 7404
    (the second inverter to put the serial back true because the signal output is true to begin with),
    and now only a single 0.1 uF cap between the second inverter output and ground where it also
    connects to the micro UART input. I couldn’t tell you right now if the capacitor is still needed.
    The 7404 would limit frequency to about 8MHz, but I don’t know if the noise was faster than that.
    I was just copying the application I stole that receiver part from where it’s buffered with 7404 as well.

    It’s a definite win, I have sent text files at 2400 baud with no error, and my application only requires 5 byte commands! :)
     
  8. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,061
    3,823
    Most likely the Lunch was the biggest part of the solution.
     
Loading...