SMPTE Interface (Need Analog Assist)
JonnyMac
Posts: 9,107
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.
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.
Comments
Even better would be to use a comparator like the LM339 instead of the op amp and get rid of R2.
Also left off the positive feedback resistor, which should also be around 1 meg. Sorry, having one of those days.
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
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
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.
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.
How about a two transistor solution?
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?
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
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
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
You did say Propeller right? ... right? ... 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.
Note: It wouldn't hurt to have another diode going to Vdd ... I was more concerned with negative voltage
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
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).
what are the pull-up values? ... are they all 10k?
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.
Andy
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
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.
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
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!
have an output
Makes sense since the hysterisis was around 144mv
Tom
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.
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.
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
Hope the trade shows went well. I remember those days... 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
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.