12Bit DAC

By Robert Sprowson

Originally published in EUG #39

This simple project is a 2 chip solution of how to convert from a digital numerical value, back into a 'real world' analogue voltage. Applications for a digital to analogue converter are very varied, from tuning a TV card from your computer to the generation of a custom (software definable) waveform - e.g. sinewave, squarewave, sawtooth.


Parts

The circuit diagram shows electrically how to assemble the unit. It requires the following parts:

1 x Maxim 7543 DAC chip (16 pin)
1 x 16 pin DIL socket
1 x 8 pin DIL socket
1 x Cheap Op Amp,such as the 741

In addition, you'll need a low current power supply. It must be capable of supplying +12v and -12v.

Benefits

  • Full 12 bit accuracy
  • Simple software control by just three serial wires
  • Full swing from 0v to 12v provided

To Build It

  1. Following the circuit diagram, the DAC is connected with its STB3 (pin 10) connected as the clock to the BBC User Port line PB0.
  2. The data is shifted in on SRI (pin 7) and connected to the BBC's PB2 line.
  3. The command to load the serial data into the DAC's output latches is given by pulsing the load line, LD2 which goes to the BBC's PB1 on the User Port.
  4. To ensure that the output of the DAC is the right way up (i.e. from 0v to 12v, not 0v to -12v) and Op Amp of gain -1 is used. This corrects the phase.
  5. The 5v required by the registers inside the DAC come from the BBC's User Port and the two circuits (the BBC and the DAC) are connected to common ground.

Driver

The software is simplicity itself - on running, the display will clear and the computer waits for a keyboard press.

The arrow keys increment/decrement the value on the DAC output, displaying the numerical value of it (0 to 4095) on the screen. In addition, pressing the A key will toggle the state of the PB3 line on the User Port. This was intended to turn on/off the AFC button on a TV tuner card.

Hints

  • Use the +5v and -5v lines from the BBC instead of +12v and -12v if the range of voltages required does not exceed 0v and +5v. This saves on you having to build a separate PSU. But remember you can't load the -5v line!
  • Socket the parts if possible, as this will facilitate easy replacements if you make a mistake and fry the chips.
  • Any pair of resistors will do by the op amp, as long as they are the same value and larger than about 1k. This is because the gain of an inverting op amp is approximately (Rfeedback/R in)

Happy soldering!

Robert Sprowson, EUG #39