Operating Modes
Why the Modes Exist
Most instruments that combine a function generator and an oscilloscope contain two independent analog chains that happen to share a box. WaveLink does not. It contains one set of analog hardware that is switched between roles by six relays, and the operating mode is simply the name of the current switch configuration.
Understanding this takes about two minutes and explains every restriction the instrument imposes.
The oscilloscope has no front end of its own
There is no dedicated scope amplifier on this board. The measurement path is assembled out of parts that belong to Channel 1:
- The comparator’s reference is CH1’s signal DAC. The 16-bit SAR works by having the DAC propose a voltage and asking an LM393 comparator whether the input is above or below it. The DAC is not “also” used by the scope — it is the scope’s reference.
- The gain stage is CH1’s gain stage. Relay K5 redirects CH1’s
de-amplifier/amplifier potentiometer pack — the same X9C wipers the
aandgcommands drive — out of the generator output path and into the comparator stage.
Two consequences follow immediately, and they are the two rules that shape everything else:
Rule 2. The 16-bit SAR is only available when the DDS is completely stopped. If the direct digital synthesis interrupt were writing the signal DAC while the SAR routine walked it bit by bit, the two would fight and neither would produce a correct result.
Rule 2 is why the 16-bit path exists in exactly one mode — Oscilloscope mode — and why every other measurement in the instrument is made with the ATmega’s internal 10-bit ADC, which touches no DAC at all.
Channel 2’s hardware has two jobs too
CH2 has its own potentiometer pack (ba / bg) and its own 16-bit DAC. But in
single-channel generator modes, that hardware is not generating anything — it is
producing Channel 1’s DC offset. The offset DAC and the ba/bg chain are
CH1’s offset hardware.
In Dual mode this reverses. Both channels run their own synthesiser, so the
offset DAC is no longer an offset generator — it is CH2’s waveform. That is why
the static offset command bd is refused in Dual mode: there is no spare
converter to hold a DC level on.
This also explains a confusing symptom people hit before the app started disabling the affected controls: in CH1 Generator mode, adjusting CH1’s offset visibly changes what CH2’s “amplitude” control reports, because they are the same two wipers.
The timer is shared
There is one DDS timer interrupt. In single-channel modes it services one channel at 40 kSa/s. In Dual mode it services two, so each channel gets 20 kSa/s, which halves the usable frequency ceiling from 20 kHz to 10 kHz per channel.
Disabling one channel in Dual mode (via the channel-enable mask) stops ticking that channel’s synthesiser and returns the surviving channel to the full 40 kSa/s.
The relay map
Five relays implement the switching. K1 configures the signal path, K2 and K3 are the output mute gates, K4 connects the scope input, and K5 performs the redirect described above.
| Configuration | K1 | K2 (CH1 gate) | K3 (CH2 gate) | K4 (scope in) | K5 (redirect) |
|---|---|---|---|---|---|
| CH1 generator | off | off | ON | off | off |
| CH2 generator | ON | ON | off | off | off |
| Dual, both channels | ON | off | off | off | off |
| Dual, CH2 disabled | off | off | ON | off | off |
| Oscilloscope | off | ON | ON | ON | ON |
| CH2 generator + scope | ON | ON | off | ON | ON |
Read the mute gates carefully — an energised gate relay mutes its channel. In the CH1 generator row, K3 is energised because CH2 is the channel being silenced. In the Oscilloscope row, both gates are energised because neither BNC should be driven while the board is measuring.
What this means in practice
You do not choose a mode because you prefer it. You choose the mode that makes the hardware you need available, and you accept what that costs:
| You want to… | Mode | What it costs |
|---|---|---|
| Generate on one channel, nothing else | CH1 Generator / CH2 Output | No measurement at all |
| Measure at the highest resolution | Oscilloscope | No generation at all |
| Generate two independent signals | Dual Independent | Half the sample rate; no static offset; no measurement |
| Generate and measure simultaneously | CH2 Gen + Scope | CH1 cannot generate; 10-bit measurement only |
The next page describes each of the four in detail.
Updated · Full project report (PDF)