Shop OBEX P1 Docs P2 Docs Learn Events
SMPTE Interface (Need Analog Assist) — Parallax Forums

SMPTE Interface (Need Analog Assist)

JonnyMacJonnyMac Posts: 9,107
edited 2014-01-18 07:46 in Propeller 1
I have an existing Propeller circuit that I'd like to retrofit with a SMPTE LTC interface. The input is an unbalanced 1V, peak-to-peak audio signal from a show control system. What I want to do is create a clean input for the Propeller so that I can extract the timecode from the stream. In my circuit the input is already pulled-up to Vdd through a 10K so the final stage of my new circuit is an open-collector NPN.

Analog electronics is not my strong suit so I'm hoping -- after the laughter dies down -- that I can get a bit of feed back from you guys who are great with opamps. The circuit I put together is supposed to behave as a Schmitt input switching at about 2.2 and 2.6 volts. The input is biased to 2.5v. My thought is that the with capacitive coupling required, anyway, the bias around 2.5 and the settings for the feedback resistors should allow the circuit to give me a clean output, even when the signal is lower than 1vpp.

As far as opamp I was looking at the OPA350 which uses a single-ended supply and goes nearly rail-to-rail on the output.
774 x 295 - 51K
«1

Comments

  • kwinnkwinn Posts: 8,697
    edited 2011-04-22 13:01
    You might want to try this circuit instead. The circuit is simpler and the threshold for both inputs is the same so it is more stable. Start with 4.7K for R1 and 1 Meg for R2. The circuit might work without R2, but it might also oscillate. Depends on the op amp you are using.

    Even better would be to use a comparator like the LM339 instead of the op amp and get rid of R2.
  • kwinnkwinn Posts: 8,697
    edited 2011-04-22 13:04
    Oops - forgot the attachment.Attachment not found.

    Also left off the positive feedback resistor, which should also be around 1 meg. Sorry, having one of those days.
  • JonnyMacJonnyMac Posts: 9,107
    edited 2011-04-22 13:15
    Actually, I was looking for a little hysteresis as the input waveform is not always pretty -- see attached.
    680 x 400 - 219K
  • tdlivingstdlivings Posts: 437
    edited 2011-04-22 13:53
    Jon
    As Kwinn mentioned op-amps as comparators may or may not work. They can break into oscillation.
    The 339 comparator is popular and Radio Shack stocks them. Only in a quad 14pin dip. I was looking for a dual
    myself but did not find one.
    The feedback resistor should go to the positive input as you show and I think Kwinn wants it that way also.
    You do not need the 4.7K resistor in series with the plus input as the voltage divider resistors will act as a
    series resistor from half the supply.
    For a 339 zero crossing circuit I built I used 5.6K's to divide the supply in half and a 10Meg feedback resistor
    for hysteresis.
    Also a trap to watch out for is the open collector output will only pull down hard and the rise time going back
    up is an RC time constant of your pull up resistor and any real or stray capacitance. Your circuit and the
    LM339 have the same issue. RC rise time may be fine but you need to check it.

    Also I have not tried it but the LM339 data sheet says it works down to 2 volts has open collector output.

    Tom
  • JonnyMacJonnyMac Posts: 9,107
    edited 2011-04-22 14:15
    Based on Kwinn's post I downloaded the LM339 datasheet and modified by circuit per attached. There is a section on adding hysteresis to the comparator; I plugged these numbers into a spreadsheet to set the window that I think will be best for the expected input.
    550 x 331 - 43K
  • tdlivingstdlivings Posts: 437
    edited 2011-04-22 14:35
    Jon
    I do not see a pull up on the LM339 output unless it is on the circuit this is connected to on pin 3
    I am going to guess you do actually have one but just in case I mention it here.

    Tom
  • kwinnkwinn Posts: 8,697
    edited 2011-04-22 14:36
    Attachment not found.

    Sorry Jon, I was a bit distracted during my first post. This is the schematic using a comparator I intended to post. You could possibly use an op amp but it is more troublesome. It is a peak detection circuit so it avoids a lot of the low noise near the mid point, and both the + and - inputs use the same DC bias voltage so there is no problem with the threshold drifting. The 4.7K resistor and 0.1 uF capacitor creates a slight voltage lag between the 2 inputs, so when the input signal peaks and reverses direction the output of the comparator changes state. R2 is the positive feedback resistor that gives the circuit some hysteresis and noise immunity. Increasing it's value makes the circuit more sensitive.

    PS - as tdlivings says the open collector circuit may have a longer rise time than fall time which may create problems. A 3.3V comparator with output drive in both directions would be better.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-04-22 16:29
    biasedflipflop.JPG

    This circuit is incorrect. You will need to use 2 caps to feed each divider separately.
    My weak point is analog, so as soon as I can I convert to the digital realm.

    So, years ago I built a flip-flop using a pair of CMOS gates and 4 biasing resistors. You can use a pair of nand gates cross coupled. Each input is a separate voltage divider using, for example a 10K and a 47K. The 10K and 47K are swapped between +3V3 and GND for each input, providing a nice hysterisis. You can calculate the resistor values for the biasing you require. This proved a very effective and resilient circuit and was produced in commercial quantities for a minicomputer.

    The reason this works simply is that the input to the gates is a very high impedance. Now, note if you have 2 prop inputs, you could do this in code and dispense with the gates, which makes for a simpler interface.
    503 x 360 - 19K
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-04-22 16:49
    Jon,

    How about a two transistor solution?
    1024 x 575 - 73K
  • JonnyMacJonnyMac Posts: 9,107
    edited 2011-04-22 17:12
    I'm always for simpler. Simple guy. Simple circuits.

    I really need to to capacity couple hte circuit and I'd like it to work down to 0.5v,p-p (0.25v swing to either side of zero cross). I guess I could bias the base of the transister set sensitivity. No?
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-04-22 17:21
    Jon,

    Yes, you should be able to bias the base as well as capacitively couple the input. As it is with a direct connection, I forgot to mention, the turn-on threshold is about 0.8V while the turn-off threshold is about 0.5V

    I'll get back to you on that circuit for 0.5v,p-p
  • tdlivingstdlivings Posts: 437
    edited 2011-04-22 19:55
    Jon
    I tried your circuit with Electronics Workbench and it did not like 3.3v as a supply. Does not mean the real part has
    a problem as the math models are not always accurate. Even thought the data sheet says works at 2 volts I was suspect as
    the chip is from an era of 12 volt and 5 volt supplies.
    I will give it a try with a real LM 339 tomorrow.

    Tom
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2011-04-22 22:04
    Jon, The simple circuit may be adequate, but I thought I'd mention there's a stand-alone VLSI chip that should handle all the hassles of reading LTC (even at fast transport speeds). Check out the Integrated Device Technology ICS2008B. I recall it's about $20, and comes in a PLCC package. It'll add a bit to your cost, but it'll work more reliably than the simple interface I'm seeing here. You'll still have plenty of coding to do!

    A couple of points of interest regarding the chip, in case it's useful to you, is that it can also decode VITC on any line, LTC at slow or fast transport speeds, and generate VITC (into a supplied video signal) and LTC.

    Disclosure: I haven't personally tried this chip but investigated it for a project I was doing. Mine was reading/writing VITC, but I noted its LTC functionality as well.

    -- Gordon
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-04-22 23:42
    Jon,

    You did say Propeller right? ... right? :smile: ... this is basically the front end to a RF detector I was playing with early this year. Ideal for picking off very weak signals. Has potential for many other applications.

    You might need to play around with R2 and R3 but the values in the schematic should get you in the right ball park.

    Keep in mind, if R3 is too high, then Pin2 will see the 'noise' generated in the feedback loop that maintains the I/O threshold. For really small signals ( a few mv ) increase R2 to 10 Meg or more. R3 should scale proportionally.

    attachment.php?attachmentid=80486&d=1303540430

    Note: It wouldn't hurt to have another diode going to Vdd ... I was more concerned with negative voltage
  • RS_JimRS_Jim Posts: 1,766
    edited 2011-04-23 06:25
    Jon,
    There is a company in your area that specializes in used broadcast equipment. (www.broadcaststore.com). At one time they had a great library of schematics of all things TV including editing equipment that could read ltc. You might contact them and see if you can get your hands on a 90's videotape editor diagram that accepted that input. You might want to clamp the input as when the deck goes into a fast mode, the output leval climbs above 1 V P-P.
    Jim
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-04-23 06:31
    I just corrected an error on my circuit above.

    But, as I said, using 2 prop inputs, each biased with high value resistors and fed via caps should work (4 resistors and 2 caps).
  • JonnyMacJonnyMac Posts: 9,107
    edited 2011-04-23 07:14
    I really appreciate all the feedback and help, guys -- I'm investigating all. Do understand that this will attach to an existing circuit and the pins I have access to have pull-ups to 3.3v that cannot be removed. Any circuit suggestions (and I'm really appreciative of them) have to contend with the pull-ups on the Propeller pins. If this was a fresh design life would be a little easier I suspect.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-04-23 08:16
    Jon,

    what are the pull-up values? ... are they all 10k?
  • AribaAriba Posts: 2,690
    edited 2011-04-23 08:33
    Another simple circuit. I would use a 74HC14 logic IC with 6 schmitt trigger inverters.
    At 3.3V supply they have a hysteresis of ~0.8V, but you can reduce this hysteresis with a feedback resistor (perhaps 180..390 kOhm). If the feedback resistor is to low the inverter begins to oscillate.

    attachment.php?attachmentid=80495&d=1303572798
    Andy
    315 x 145 - 1K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-04-23 10:13
    Jon,

    Your waveform shows a 2V P-P span. SMPTE is nominally 0.8V P-P @75 ohms. None of the circuits shown so far have 75-ohm input termination, so I wonder if some of the "not pretty" stuff could be due to line reflections. Can you repeat your analog data capture with a 75-ohm termination resistor and see if that helps any?

    OTOH, the waveform might also suggest that there is a termination resistor after a coupling cap, and the cap is being discharged too quickly. If so, a larger cap would help. Or you could put the cap after the termination resistor.

    -Phil
  • kwinnkwinn Posts: 8,697
    edited 2011-04-23 11:02
    Attachment not found.

    I know you probably have more suggestions than you ever expected, and certainly more than I did, but I could not resist adding one using my all time favorite chip (next to the prop of course). The resistor values are for the cmos version of the chip and would need to be changed if you used the older version with 5K internal resistors.
  • tdlivingstdlivings Posts: 437
    edited 2011-04-23 11:05
    Jon
    As I said I would I tried a real Lm339 at 3.3v and it worked fine.
    I built your circuit not kwinn's. With the 4 100K and a 10K pul up on the output.
    The circuit you showed with 3.3v supplys.
    Here are some pics of the output at various frequencys and one using cursors to show
    hystersis.

    The only change is I used a 0.22uf input cap with a 50k input Z that would be good down to
    15Hz . If Phil is right it would need to be much bigger for 75ohms

    Tom
    320 x 234 - 21K
    320 x 234 - 19K
    320 x 234 - 19K
    320 x 234 - 19K
    320 x 234 - 19K
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2011-04-23 11:14
    RS_Jim wrote: »
    At one time they had a great library of schematics of all things TV including editing equipment that could read ltc. You might contact them and see if you can get your hands on a 90's videotape editor diagram that accepted that input.

    Good idea. Almost all of the circuits I've ever seen use a comparator with hysteresis, except in differential mode rather than single-ended. If I can find my old Adrienne LTC timecode ISA card Jon is welcome to have it to reverse engineer! (Now where did I put that thing...)

    A few years back there was a discussion of a similar project over on the old Arduino forum. A Web search should turn it up. The circuit the guy used was pretty simple, using an NPN transistor rather than a comparator. In my experience, the lack of input conditioning means it may not work reliably on all sources.

    For a project I did in 2005 the simple input circuits I tried didn't work well for all the decks the client had, and as I was being paid by the hour, it was cheaper for the client to purchase an LTC-to-serial converter. We all know Jon likes a challenge, so store-bought it out! :smile:
  • tdlivingstdlivings Posts: 437
    edited 2011-04-23 11:27
    As a test I reduced the input down to 200mv pp and that is about as low as I could go and still
    have an output
    Makes sense since the hysterisis was around 144mv

    Tom
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-04-23 14:14
    Jon,

    I haven't put this circuit together, but the simulator shows that it will do what you want... It's a derivative of my first schematic which I have put together and used.
    1024 x 638 - 109K
  • JonnyMacJonnyMac Posts: 9,107
    edited 2011-04-24 05:54
    Your waveform shows a 2V P-P span. SMPTE is nominally 0.8V P-P @75 ohms.

    That graphic was from an audio program so it should be 1v p-p. What concerned me was the less-than-sinusoidal wave shape (this is from a website explaining SMPTE LTC). I have a file from my friend that is much cleaner. My goal, of course, is to have the circuit work under worst-case conditions.

    Again, gents, I sincerely appreciate all the feedback and ideas.
  • LtechLtech Posts: 380
    edited 2011-04-26 12:30
    I make an amalgam of Arduino for decoding ltc, and Propeller for big numbers video output on 70" monitor.

    I use it to de-count 3 min from a recording digital betacam.
    The client (tv station ) want to get the timcode at 3 min for first picture of program.
    The presentator wants to know the already recorded time (yes he is a litelebit difficult!)

    If you can get the ltc (de)coding part in the prop working, It will be very useful for me to analyze.
    I try a lot, but I am not an expert on spin. Fast way was using an Arduino !

    Arduino part:
    http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1197522709/13

    Ps I use the transistor described, but it is not so sensitive (= ok for direct betacam output)
    and no jogging suport

    http://www.waxweb.org/addl/arduino-simple-timecode-input.jpg
  • JonnyMacJonnyMac Posts: 9,107
    edited 2011-04-26 18:02
    Thanks, LTech, I'm going to prototype that circuit as soon as I get home (from trade show travels). I have an idea about the decoding, though it would be in PASM, not in Spin. That said, it should still be quite friendly and as an object you should be able to drop it into your own project(s) at will.
  • RS_JimRS_Jim Posts: 1,766
    edited 2011-04-27 06:20
    Jon,
    Hope the trade shows went well. I remember those days...
    The simple circuit may be adequate, but I thought I'd mention there's a stand-alone VLSI chip that should handle all the hassles of reading LTC (even at fast transport speeds). Check out the Integrated Device Technology ICS2008B
    The Prop should be quite capable of reading both ltc and vitc. It will just depend on how much of the prop's resources you want to expend.$20 vs a prop? In my book th prop wins in the cost effectiveness department!
    Jim
  • JonnyMacJonnyMac Posts: 9,107
    edited 2011-04-27 09:51
    As I pointed out earlier this is an attempt to add to an existing project, and simpler is better -- I'm encouraged by LTech's success with the Arduino.

    Based on what I've read I don't think the code will be terribly difficult ("terribly" being completely subjective). I'm pretty certain I can get it into a PASM cog that provides two longs to the main process: one with the time code (BCD as $HH_MM_SS_FF) and one with user flags.
Sign In or Register to comment.