Overview

The MCP3208 is a 12-bit Analog-to-Digital Converter (ADC) IC manufactured by Microchip Technology. It features 8 single-ended input channels (or 4 pseudo-differential pairs), an internal successive-approximation register (SAR) architecture, and a 4-wire SPI serial interface.

Capable of sampling up to 100 kSPS (kilosamples per second) at 5 V supply, the MCP3208 is widely used to add precise multi-channel analog input capabilities to single-board computers (such as the Raspberry Pi, which lacks native onboard ADCs) and to expand resolution on 10-bit microcontrollers (like the Arduino Uno).

Quick reference

Supply voltage (VDD)2.7 V to 5.5 V DC
Resolution12-bit (4,096 discrete steps)
Channels8 single-ended or 4 pseudo-differential pairs
Sampling rate100 kSPS (at 5.0 V) / 50 kSPS (at 2.7 V)
InterfaceSPI (SPI Mode 0,0 and Mode 1,1)
Reference voltage (VREF)0.25 V0.25\text{ V} to VDDV_{DD}
Active current draw400 μA400\ \mu\text{A} typical (at 5V) / 500 nA500\text{ nA} standby

Pin Configuration (DIP-16 / SOIC-16 Package)

text
             ┌───┴───┐
       CH0 ──┤ 1   16├─ VDD
       CH1 ──┤ 2   15├─ VREF
       CH2 ──┤ 3   14├─ AGND
       CH3 ──┤ 4   13├─ CLK
       CH4 ──┤ 5   12├─ DOUT
       CH5 ──┤ 6   11├─ DIN
       CH6 ──┤ 7   10├─ CS/SHDN
       CH7 ──┤ 8    9├─ DGND
             └───────┘
PinNameTypeDescription
1–8CH0CH7Analog InputAnalog input channels 0 to 7
9DGNDPowerDigital Ground reference
10CS/SHDNDigital InputActive-Low Chip Select & Shutdown
11DINDigital InputSPI Data Input (MOSI from MCU)
21DOUTDigital OutputSPI Data Output (MISO to MCU)
13CLKDigital InputSPI Serial Clock
14AGNDPowerAnalog Ground reference
15VREFAnalog InputVoltage Reference input (0.25 V0.25\text{ V} to VDDV_{DD})
16VDDPowerPower supply (+2.7 V to +5.5 V DC)

Specifications

ParameterSymbolMinTypMaxUnitConditions
Supply VoltageVDDV_{DD}2.73.3 / 5.05.5VDC supply
Reference VoltageVREFV_{REF}0.25VDDV_{DD}VAnalog reference
Integral NonlinearityINLINL-1±0.75\pm 0.75+1LSBVDD=VREF=5.0 VV_{DD} = V_{REF} = 5.0\text{ V}
Differential NonlinearityDNLDNL-1±0.5\pm 0.5+1LSBNo missing codes
Clock Frequency (VDD=5VV_{DD}=5\text{V})fCLKf_{CLK}0.012.0MHz100 kSPS max rate
Clock Frequency (VDD=2.7VV_{DD}=2.7\text{V})fCLKf_{CLK}0.011.0MHz50 kSPS max rate
Conversion Timetconvt_{conv}1212clock cyclesAfter sampling acquisition

SPI Framing & Channel Selection

To sample a channel, the MCU pulls CS Low and transmits 3 command bytes over DIN:

  • Start Bit: First logic High bit.
  • Single/Diff Selection (S/D): High = Single-ended (8 channels), Low = Differential (4 channel pairs).
  • Channel Address (D2, D1, D0): 3-bit channel select (000 for CH0 up to 111 for CH7).

During transmission, the MCP3208 samples the analog channel and returns 12 data bits on DOUT (D11D_{11} to D0D_0).

Vin=ADC Output Code4096×VREFV_{in} = \frac{\text{ADC Output Code}}{4096} \times V_{REF}

Wiring

MCP3208 PinRaspberry Pi GPIOArduino UnoNotes
16 (VDD)3.3V / 5V5VDecoupling cap 0.1 μF0.1\ \mu\text{F} required
15 (VREF)3.3V / 5V5VAnalog reference input rail
14 (AGND)GNDGNDConnect to quiet analog ground
9 (DGND)GNDGNDDigital system ground
13 (CLK)GPIO 11 (SPI0_SCLK)D13SPI Clock
12 (DOUT)GPIO 9 (SPI0_MISO)D12SPI MISO
11 (DIN)GPIO 10 (SPI0_MOSI)D11SPI MOSI
10 (CS)GPIO 8 (SPI0_CE0)D10Active-Low Chip Select

Example

cpp
#include <SPI.h>

const int CS_PIN = 10;

uint16_t readADC(uint8_t channel) {
  uint8_t command = 0xC0 | ((channel & 0x07) << 3); // Start bit (1) + Single-ended (1) + D2 bit
  
  SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));
  digitalWrite(CS_PIN, LOW);
  
  SPI.transfer(command);
  uint8_t b1 = SPI.transfer(((channel & 0x07) & 0x03) << 6); // Send D1, D0
  uint8_t b2 = SPI.transfer(0x00);
  
  digitalWrite(CS_PIN, HIGH);
  SPI.endTransaction();
  
  uint16_t result = ((b1 & 0x0F) << 8) | b2;
  return result; // 0 to 4095
}

void setup() {
  Serial.begin(9600);
  pinMode(CS_PIN, OUTPUT);
  digitalWrite(CS_PIN, HIGH);
  SPI.begin();
}

void loop() {
  uint16_t raw = readADC(0); // Read Channel 0
  float voltage = (raw / 4095.0) * 5.0;

  Serial.print("CH0 Raw: "); Serial.print(raw);
  Serial.print(" | Voltage: "); Serial.print(voltage); Serial.println(" V");

  delay(500);
}

Common mistakes

  • Leaving VREF disconnected: The chip requires an explicit reference voltage on pin 15. If left floating, ADC output codes will read 4095 continuously.
  • Forgetting AGND and DGND connection: Both ground pins must be connected to 0V ground. Joining them at a single star-ground point near the chip eliminates digital switching noise on analog measurements.
  • Overclocking SPI at 3.3V supply: At 2.7V–3.3V supply, maximum SPI clock rate drops from 2.0 MHz to 1.0 MHz. Running clock speeds >1.0 MHz>1.0\text{ MHz} at 3.3V causes data bit errors on DOUT.

Notes

  • MCP3008 vs MCP3208: The MCP3008 is a 10-bit version (1,024 steps); the MCP3208 provides 12-bit resolution (4,096 steps) with the exact same pinout.

Assets & downloads