MCP4912-E/ST 12-Bit DAC: Datasheet, Application Circuit, and Programming Guide
The MCP4912-E/ST is a single-channel, 12-bit digital-to-analog converter (DAC) from Microchip Technology, offering a compact and cost-effective solution for precision analog output generation. It is part of the MCP4902/4912/4922 family, distinguished by its 12-bit resolution and a versatile SPI-compatible serial interface. This device is housed in a small TSSOP-14 package, making it suitable for space-constrained applications such as industrial control, data acquisition systems, and programmable voltage sources.
A thorough review of the datasheet is essential for proper implementation. Key specifications include:
Resolution: 12 bits, providing 4096 (2^12) possible output levels.
Interface: Standard SPI protocol, with a clock speed of up to 20 MHz.
Output Voltage Range: Determined by an external voltage reference (VREF). The output swings from 0V to VREF.
Settling Time: Typically 4.5 µs to within ±1/2 LSB, enabling rapid output response.
Power Consumption: Low power operation, with a typical supply current of 450 µA during normal operation.
On-Board Output Amplifier: Provides a low-impedance output buffer, which can source up to 25 mA.
Typical Application Circuit
A basic application circuit for the MCP4912-E/ST is straightforward. The core components are:
1. Power Supply (VDD & GND): Decouple the 2.7V to 5.5V power supply with a 100 nF ceramic capacitor placed close to the IC.
2. Voltage Reference (VREF): Apply a stable, low-noise reference voltage to the VREF pin. This defines the DAC's full-scale output range.
3. Serial Interface Connections: Connect the Chip Select (CS), Serial Clock (SCK), and Serial Data Input (SDI) pins to the corresponding GPIO pins of a microcontroller (MCU).
4. Output (VOUT): The analog output voltage is available on the VOUT pin. A small series resistor (e.g., 100 Ω) and a capacitor to ground can be added to filter high-frequency noise if necessary.
The LDAC pin can be tied to GND for immediate updates upon completing the 16-bit data transfer.
Programming Guide
Controlling the MCP4912-E/ST involves sending a 16-bit data word via the SPI interface. The format of this word is critical:
Bit 15 (A/B): Selects the DAC channel. For the single-channel MCP4912, this bit is a "don't care" but is often set to 0.
Bit 14 (BUF): Controls the input buffer for the reference voltage. Set to 1 for buffered mode, 0 for unbuffered.
Bit 13 (GA): Selects the output gain. `GA = 1` selects 1x (VOUT = VREF D/4096). `GA = 0` selects 2x (VOUT = 2 VREF D/4096), but the output cannot exceed VDD.
Bit 12 (SHDN): Output shutdown control. Set to `1` for active operation. Set to `0` to shut down the output, putting the device in a low-power state.
Bits 11-0 (D11:D0): The 12-bit data value (D) representing the desired output level.
A simple code snippet for an Arduino (using the SPI library) to set an output voltage looks like this:

```cpp
include
const int CS_pin = 10; // Define Chip Select pin
void setup() {
pinMode(CS_pin, OUTPUT);
digitalWrite(CS_pin, HIGH);
SPI.begin();
}
void setDAC(uint16_t value) {
// Construct 16-bit command:
// Active mode (SHDN=1), Gain 1x (GA=1), Buffered (BUF=1), Channel (A=0)
// Combine with 12-bit value (D11:D0)
uint16_t data = 0b0111000000000000 | (value & 0x0FFF);
digitalWrite(CS_pin, LOW); // Select DAC
SPI.transfer16(data); // Send 16-bit command
digitalWrite(CS_pin, HIGH); // Deselect DAC
}
void loop() {
setDAC(2048); // Set output to mid-scale (e.g., 2.5V if VREF=5V and Gain=1x)
delay(1000);
}
```
The MCP4912-E/ST is an excellent choice for designers seeking a simple, high-precision, and SPI-driven DAC. Its compact form factor, combined with flexible output configuration through gain and shutdown bits, makes it a versatile component for a wide array of digital-to-analog conversion tasks. Careful attention to the voltage reference quality and PCB layout is key to achieving optimal performance.
Keywords: SPI Interface, 12-Bit Resolution, Voltage Reference, Output Buffer, Serial DAC.
