Back to the 2025 paper

Module 4: DAQ Systems

20257m

A system uses an SPI-based 8-bit DAC to generate an analog output signal between 0–5 V.
(i) Explain the SPI timing requirements and derive the formula for DAC output voltage.
(ii) If the SPI clock is 4 MHz, calculate the maximum update rate achievable.

Worked SolutionAI Assisted

Solution: SPI 8-bit DAC

Given:

  • DAC resolution = 8 bits
  • Output range = 0–5 V
  • SPI clock = 4 MHz

(i) SPI Timing and DAC Output

SPI is a synchronous serial protocol. The master provides the clock on SCLK, sends data on MOSI, and selects the DAC using chip select (CS).

Typical sequence:

CS ↓ → Send command/data bits on MOSI → Clock pulses → CS ↑ → DAC updates output

The exact sampling clock edge and timing depend on the DAC's SPI mode specified in its datasheet.

For an ideal 8-bit DAC, the input code ranges from:

0 to 281=2550\text{ to }2^8-1=255

For a 0–5 V output using the common ideal endpoint convention:

Vout=D255×5V_{out}=\frac{D}{255}\times5

where DD is the decimal DAC code.

Thus:

  • D=0Vout=0D=0 \Rightarrow V_{out}=0 V
  • D=255Vout=5D=255 \Rightarrow V_{out}=5 V

The approximate voltage step is:

5256=19.53 mV\frac{5}{256}=19.53\text{ mV}

The exact transfer function should follow the DAC datasheet if it uses a different reference/output convention.

(ii) Maximum Update Rate

An 8-bit DAC requires at least 8 clock cycles per update if the SPI frame contains only the 8 data bits.

SPI clock:

fSPI=4 MHzf_{SPI}=4\text{ MHz}

Therefore:

fupdate,max=4×1068f_{update,max}=\frac{4\times10^6}{8}

fupdate,max=500,000 updates/s\boxed{f_{update,max}=500,000\text{ updates/s}}

or:

500 kUpdates/s\boxed{500\text{ kUpdates/s}}

Important practical note

If the DAC requires more than 8 bits per SPI frame—for example, command bits, address bits or control bits—the actual maximum update rate will be lower:

fupdate,max=fSPINbits/framef_{update,max}=\frac{f_{SPI}}{N_{bits/frame}}

Final Answer

  • DAC output: Vout=D255×5V_{out}=\frac{D}{255}\times5 V under the stated endpoint convention.
  • Approximate LSB step: 19.53 mV.
  • Maximum theoretical update rate for an 8-bit frame: 500 kUpdates/s.

Similar questions