Digital-to-Analog
January 25, 2007
I decided to monkey around a bit with this DAC so I could understand how it works before I through it into full use. I learned a lot tonight about the TLC7528CN as well as my parallel port and Windows XP. I started by hooking up a boat-load of hookup wire to a parallel port connector:
Now, this is just for the prototype. When I get this in a case, I’ll actually have a print port jack rather than a plug and use an extension cable between the box and the computer. Now, I simply hooked all that hookup wire into the DAC on my perf-board and put one the op-amps into service. I’m not quite sure what the op amp is trying to accomplish (U4A on the fodtracker schematic). It’s output is always 1 volt, but so is it’s input. So, yeah. Seems pointless.
Anyhow, the way the DAC works is this: You provide a “reference” that chip uses as a basis for a maximum value. Then, the input value is converted to range from 0 to that reference. My understanding is that this DAC is a current-mode chip. I’m assuming that it’s controlling the current relative to the reference. However, my sensors are going to be potentiometers, which will give me a varying voltage. According to VE2DX’s website, by hooking the reference voltage into the output terminals and measuring the voltage on the reference lines, you can use the DAC as a voltage-mode chip.
Wiggie. I had this brief flash of “aha” when I got to thinking about it and it made sense to me. However, I’m not sure I can put it into words. Perhaps someone else can explain it better. I think the op-amp feeding the DAC’s output is there to force the voltage to be 1 volt on the output lines all the time. If, by keeping the voltage to one volt there, only the current can change on the output. Then, since the input current on the chips reference lines is kept constant (by the chip, maybe??), then the reference line voltage must change relative to the output.
In other words, the DAC gets a signal for a value of 127. That’s about half way up the scale to the reference. Now, output current is changed to reflect that value. Normally, the voltage would change with the current, but the op-amp forces that the line to be at 1 volt all the time. So the current is changing with the value, but the voltage is constant. Now the reference lines are supplying the reference current, but by forcing the voltage to be the same on the outputs, the signal is force back into the reference lines in the form a voltage change that moves in relating to the outputs.
That’s my story and I’m sticking to it.
Anyhow, I got everything wired up. Now, the schematic calls for a 14v supply voltage. This voltage, I think, is supposed to come from a Yeasu rotor controller. The idea as that this interface will simply control the stock rotor controller (rather than the user hitting buttons manually). Well, I’m not doing that, so I didn’t have a 14V supply. I tossed around several ideas, and then I realized that all my radio gear runs on 13.8V lines! Eureka!
I got one of my radio power supplies out and got some Anderson Power Poles hooked up to my perf-board. I had my 13.8 volts. I confirmed that my 7805 was doing it’s job on the 5v line and that I had 1v off the op-amp. All was good.
Now, I had to figure out how to write to the parallel port. Unfortunately, Windows XP doesn’t let you just write to ports like previous versions did. Can’t have those viruses printing documents, now! I dug around in Google for a bit and found “UserPort.” I found it Here. It’s a device driver that opens up specific ports. I used it to open up my printer ports and the rest was academic.
I had downloaded the free Microsoft .Net SDK a while ago and it comes with a basic “C” compiler (my native language, really). It also supports embedded assembly language so I could poke at data ports directly. So I started writing values to the printer port and guess what?? NOTHING HAPPENED!
Whohoo!
Well, this DAC that I have is actually a dual-DAC. To tell the chip which DAC to use, I had to set a bit on the “auto linefeed” pin (remember, this is a printer port). Easy enough. I monkeyed around with that for a while and started seeing some results. But they weren’t consistent. I finally started taking the machine gun approach to programming and started setting all the control bits on the port high to get SOMETHING to happen. And it did… I was able to program one of the DAC’s. Give the parallel port a 0 - I get zero volts. Give it 255, and I got 1 volt. Give it 100, I got .3 volts (ish). It worked!
Until I tried switching DAC’s. Switching was pretty hit-or-miss. Until I figured out that the parallel port’s “strobe” pin is also hooked to the DAC. It seems that I can hit the A/B switch on the DAC all day long, but it won’t switch until you tap the strobe pin. That tells the DAC to read the “auto linefeed” pin and use it’s current value to select the right DAC.
Viola! I have two working DAC’s with a voltage from 0-1v.
Next up… hooking up the comparator circuit.



Leave a Reply