Interface Electronics 2025Laboratory 03: R2R DAC analysis instructionsProf. Jörg VollrathStart 1.12.2025 |
|
Arduino MKR WIFI 1010 (BASYS3, Rpi) Breadboard, PMOD DA2, AD2 8-Bit R2R DAC Cardboard Box Options for projects: (C serial DAC, Scalable R2R DAC, Interpolating DAC, R-String (SAR ADC, pipeline ADC) |
![]() ![]() |
Data Converter CharacterizationServer NodeJS: StartServerAx.bat ServerAx.js User Interface: Browser: Projekte/SerialA.html Arduino: Arduino/DataConverterCharV4/DataConverterCharV4.ino NodeEEBenchServer NodeJS: NodeEEBench.bat ServerEEBench.js User Interface: Browser: Projekte/NEEBench.html Arduino: Arduino/EEBench/EEBench.ino |
![]()
|
|
The schematic shows a R2R DAC. 8 Arduino pins are connected to D0..7 SketchConfiguration for DAC controlConfiguration of OSC channels DataConverterCharV4.ino AWG1: Original digital signal from generator C1: PMOD ADC C2: Arduino pin A1 C3: Arduino pin A2 C4: Arduino pin A3 |
|
|
DataConverterCharV4.ino AWG1: Original digital signal from generator C1: PMOD ADC C2: Arduino pin A1 C3: Arduino pin A2 C4: Arduino pin A3 Resistance can be added to the data lines D0..7 introducing error. |
![]() |
| Pin Arduino | Name | Name | R2R |
| D0 | D0 | D0 | D0 |
| D1 | D1 | D1 | D1 |
| D2 | D2 | D2 | D2 |
| D3 | D3 | D3 | D3 |
| D4 | D4 | D4 | D4 |
| D5 | D5 | D5 | D5 |
| D6 | D6 | D6 | D6 |
| D13 | D13 | D7 | D7 |
| A4 | OSC4 | Output R2R | Output R2R |

| Pin Arduino | Name | Name | Pin PMOD DA2 |
| D9 | SCK | CLK | 4 |
| D8 | MOSI | D1 | 2 |
| D21 | D21 | CS | 1 |
| GND | GND | GND | 5 |
| +3V3 | VCC | VDD | 6 |

| Pin Arduino | Name | Name | Pin PMOD AD2 |
| D12 | SCL | SCL | 1 |
| D11 | SDA | SDA | 2 |
| GND | GND | GND | 3 |
| +3V3 | VCC | VDD | 4 |
oscX = readADC();
Serial.print(" , ADC(AD2) = ");
Serial.print(oscX);
oscX = analogRead(ADC_OSC1);
Serial.print(" , ADC(OSC1) = ");
Serial.print(oscX);
oscX = analogRead(ADC_OSC2);
Serial.print(" , ADC(OSC2) = ");
Serial.print(oscX);
oscX = analogRead(ADC_OSC3);
Serial.print(" , ADC(OSC3) = ");
Serial.print(oscX);
oscX = analogRead(ADC_OSC4);
Serial.print(" , ADC(OSC4) = ");
Serial.print(oscX);
2024_Lab_MKRWIFI1010_R2R.html
|
|
|
Länge: 0:57:10 |
0:0:0 Laboratory Arduino R2R DAC
0:0:23 Overview
0:1:0 Hardware
0:2:40 User Interface StartServerAx.bat vs NodeEEBench.bat
0:3:53 Connect Arduino and look at it
0:5:30 Load Software from Github
0:6:40 Configure Arduino with sketch
0:8:40 StartServerAx.bat
0:10:11 Webinterface
0:11:26 Oscilloscope picture ramp Electronic Explorer
0:13:20 Operate triangle
0:14:10 Start Oscilloscope from webinterface
0:15:18 Ramp test tab
0:19:40 Screenshot saved
0:21:10 Lookup table discussion
0:22:30 Sine signal
0:24:0 FFT analysis
0:25:40 AWG Signal to noise ratio and ENOB
0:27:0 C1 Signal to noise ratio and ENOB
0:29:0 C3 Signal to noise ratio and ENOB
0:30:55 Modified R2R D6 20k+4.7kOhm , D7 20k+2.2kOhm
0:32:20 Ramp test
0:33:30 Copy lookup table
0:34:0 New Sine
0:35:43 FFT SNR
0:37:0 Download Lookup table
0:38:30 Ramp with limited range
0:38:30 Limited sine signal
0:40:10 FFT SNR
0:41:34 Modified Arduino R2R DAC
0:42:1 Ramp
0:42:34 INL,DNL graph
0:43:14 Lookup table
0:44:29 Sine and FFT
0:45:4 FFT window SNR 30 dB, 5 Bits
0:46:0 Lookup table 1.0
0:46:40 Ramp run
0:47:20 Range update INL, DNL
0:48:50 Lookup 0.9
0:49:42 INL, DNL up to 2.5
0:50:50 Lookup 1.1, ramp
0:51:40 INL, DNL result best
0:53:42 Sine signal
0:55:41 FFT SNR 44 dB, ENOB 7 Bit
0:57:10 Description
|
|
Each group gets one Arduino box. How much resitance error of the R2R can be compensated by a lookup table? Modify the resistance of data lines and measure the result. Prove this with INL, DNL, SNR measurements How can this achievement be evaluated? How can a number (Figure of merit, FOM) be calculated? Report 2 pages IEEE format + CV Submission date: 18.1.2026 6 lab sessions Filename: 2025_InEl_Lab03_<grp>_<last 2 digits, initials>.pdf Example for <grp>: M21, W72 |
Future TopicsC serial DAC Other data converter circuits |
|
The schematic shows a C serial DAC. The data (D) is serially processed starting with the LSB. (1) C1 is charged to Di level with CLK1 . (2) Charge sharing between C1 and C3 is activated with CLK2. (3) Loop through all data (4) Transfer C3 voltage to the output SH circuit via CLK3. |
The resolution NBit can be controlled via software. |
|
CD4053 3 2:1 MUX circuit MCP6022 rail-to-rail Opamp C1,C2,C3 capacitors Wiring list in handout POMOD DA2, AD2 |
![]() |
Software ArduinoC serial DAC StartServerAx.bat Arduino/DataConverterCharV5/DataConverterCharV5.ino Specific: Pin definitions Timing sequence |
![]() |
...
/* C serial CD4053 and MCP6022 */
#define DAC_INH 0
#define DAC_C12 1
#define DAC_Dx 2
#define DAC_C3 3
...
/* Init C serial control lines */
pinMode(DAC_INH, OUTPUT);
pinMode(DAC_C12, OUTPUT);
pinMode(DAC_Dx, OUTPUT);
pinMode(DAC_C3, OUTPUT);
digitalWrite(DAC_INH, LOW); // INH low activates switches
digitalWrite(DAC_C12, LOW); // CLK12 coonnects Dx with C3
digitalWrite(DAC_Dx, LOW); // Data line low
digitalWrite(DAC_C3, HIGH); // output disconnected from Voutx1
...
int activeS = 20; // 1 tested Time switches are closed for charge redistribution 1 makes 30/2048 error at 10 pF
int nBits = 9; // number of send bits
/* C serial digital write */
void digWrite(uint16_t sineValue){
digitalWrite(DAC_C12, LOW);
digitalWrite(DAC_C3, HIGH);
digitalWrite(DAC_Dx, LOW);
delayMicroseconds(activeS*5);
// write zero
for (int i3 = 0; i3 < nBits; i3++) {
digitalWrite(DAC_C12, HIGH);
delayMicroseconds(activeS*5);
digitalWrite(DAC_C12, LOW);
delayMicroseconds(activeS*5);
}
// shift nBits bits in 18ms??
for (int i3 = 0; i3 < nBits; i3++) {
if ((sineValue & bitsX[i3]) == bitsX[i3] ) {
digitalWrite(DAC_Dx, HIGH);
} else {
digitalWrite(DAC_Dx, LOW);
}
digitalWrite(DAC_C12, HIGH);
delayMicroseconds(activeS*5);
digitalWrite(DAC_C12, LOW);
delayMicroseconds(activeS*5);
}
// transfer to output
digitalWrite(DAC_C3, LOW);
delayMicroseconds(activeS*5);
digitalWrite(DAC_C3, HIGH);
}
...
![]() |
![]() |
|
The schematic shows a cyclic R2R DAC. |
![]() The resolution NBit can be controlled via software. |








| Rx | Cx | activeS | offS | INL, DNL max 255 | INL, DNL max 1024 |
| Rx | Cx | activeS | offS | INL, DNL max 255 | INL, DNL max 1024 |
| Rx | Cx | activeS | offS | INL, DNL max 255 | INL, DNL max 1024 |