I recently purchased an encoder with a 5 VDC Line driver output. I
wanted to hook it up to an atmega 2560 micro controller. Does any one
know how this can be done.. Please help
Thanks
__________________
It is better to fail in originality than to succeed in imitation.
I already looked at the encoder data sheet, that is why I am asking a question here. The data sheet does not say anything about connecting it to a micro-controller. If any one knows how to convert a differential line driver output to a TTL that the mc accepts, please let me know.
__________________
It is better to fail in originality than to succeed in imitation.
You are a little weak on details so take all this with a grain of salt.
Your second posting (post #2) suggests to me that the output can be +5V/GND or GND/+5V. You need to confirm from the data sheet that this is true.
The most straightforward solution is to use a differential line receiver chip. If your uC is a +3.3 V controller then you either need a receiver with +3.3/gnd outputs or you need uC pins that are +5V tolerant.
If you are trying to keep your cheap chip count low then....
If above is true then one line switches back and forth between +5 and gnd based upon data. I have never split apart differential lines like this but you could probably use one of then as a +5V/gnd signal. If you need to comply with +3.3V inputs then CONSIDER (I didn't say that it would work for your circuit) using a series resistor and a clamping diode to +3.3V.
Everything above relates to voltage level compatibility. You still need to deal with timing, interrupts, polling, understanding the signal encoding, etc.
Bruce
__________________
Few things limit our potential as much as knowing answers and setting aside questions.
I am trying to accomplish this without a receiver. The encoder outputs a constant 5vdc (GND/+5v) using a line driver 26LS31 which is compatible with a an RS-422A cable.
I am using an Atmega2560 uC which is +5V tolerant.
Is there a simple circuit that I can build myself to get single ended output? I do not have time to buy the compatible line receiver. Can you link me to any resources.
Thanks.
__________________
It is better to fail in originality than to succeed in imitation.
One is indeed the inverse of the other. The data sheet is on the link below. I checked the outputs on a scope and all I see is a constant output of 5 Volts on both the A and NOT A lines. Am I not supplying the voltages correctly? I am connecting a regulated
5VDC from my uC to the power source (brown wire) and the ground to the
shield.
The second page has the wave form line driver output option.
I sounds like we both agree on the fundamentals of what you are doing. Also, neither one of us is 100% on top of it. Therefore, I suggest the following:
Take one output and load it with a 10 Kohm resistor to ground. Look at it with an oscilloscope. If the waveform seems to look like and behave like the data sheet drawing then I would think that you are in good shape. I don't know what load is a "best choice", but for a quick experiment 10 Kohm should be a good start.
I don't know what you are doing but ESD and other sources of voltage spikes can make a uC very unhappy (and you too). Consider clamping diodes and any other form of protection that might be appropriate.
Bruce
P.S. Keep in mind that I am pulling this out of thin air while I take a short break from my other tasks. If anything fails the "sanity test" then remember that I might be wrong.
__________________
Few things limit our potential as much as knowing answers and setting aside questions.
The official 26LS31 parts made by several companies have long been discontinued, although they have been replaced by parts that do the same thing. According to the 26LS31 datasheet, each of its EIA-422 outputs comprises two TTL signals with one signal inverted from the other. The 26LS31 has four such dual-output drivers. I'd expect that your encoder will use two sets of them.
The datasheet defines its logic LO output as less than 0.5V and its HI as greater than 2.5V, which are classic TTL levels. I imagine the maximum HI will be under 4 volts.
Presumably you have a ground connection available along with the
balanced signals. You should be fine simply taking ground and one side (e.g., the + side) from each of the balanced signal pairs for your microcontroller quadrature encoder input.
Please excuse the 26LS31 drawing from the original Signetics datasheet - it's very poorly done. The true output from the dual-output driver looks more like a three-state input, at least to those of us used to looking at such things.
I actually ordered the line driver ciruit by mistake. I just wanted a single ended output and I was able to get it from a sigle channel. I reliazed later I had the been using the wrong wire as ground. However, as I mentioned in another post, in this group in the electircal engineering fourm: http://cr4.globalspec.com/thread/58298/Possible-Causes-for-Error-in-an-Incremental-Encoder
I am having problems with the signal I am getting. I was not sure if this is caused by the 26LS31 Line driver in the encoder, others have suggested it might be an alignment problem. I would very much like your expert opinion on it.
In addition, when supplying the encoder with a 4.89 VDC/ 0.6mA from my microcontroller, the output signals are in the levels of 3.25 Volts. It does not cause any problems in triggering, but I do not understand why there is such a huge drop. Is the amperage too low.
Thanks agian for all your comments.
__________________
It is better to fail in originality than to succeed in imitation.
3.25 volts is fine. The drawing shows a typical TTL-style totem-pole inverting-gate output stage (actually a NAND gate in this case: both inputs have to be HIGH for the output to go LOW). If you imagine a LO input, and follow the circuit for a logic HI output, you see R2 pulling up V3. So we have a Vbe drop of about 0.7 volts, plus another similar drop across the diode-connected isolating-transistor V5 to the output, so we have 4.89 - 1.4 = 3.49, which is pretty close to what you observed.
BTW, the 26LS31 will want more than 0.6mA for its operating current. I can't speak for the encoder, but I'd imagine it needs to draw more current as well.
Good Answers: