Rationale and goal

An arbitrary waveform generator is a standard tool for almost every budding electronics engineer. However these devices are costly - Even the relatively cheaper ones with specifications like 150MS/s, 50mhz, 14-bit cost above $300. There are under $10 signal generators, but their usage is very limited and they certainly cannot generate arbitrary waveforms. The $300 to $500 range devices are very reliable,  accurate and get most of your work done including low frequency RF applications - However is this really necessary? Practically what most engineers need 90% of their time is a waveform generator with high enough bandwidth (> 25 MHz) a corresponding sampling rate (> 100 Msps) and 8-bits of 99.99% accurate resolution with 2 channels which can be used simultaneously. The internal clock should also be good (< 100 ppm at least). Our ultimate goal is to create such a device under $50 production cost.

Source code

Github - PicoSigGen


Design - High Msps bit pattern generator

The problem with using standard low cost development boards is the that they cannot generate n-bit signals consistently aligned to a clock edge at high sample rates. Using something like a GPIO is never a good idea since buffering the signal and aligning it to a clock requires additional hardware which makes the whole thing costly. But what if a board already had an inbuilt mechanism to do so? With the launch of the Raspberry Pi Pico a few years back, we finally have such a board. It has a special hardware module called PIO (programmable I/O) which allows the programmers to write some specialized assembly code which achieves exactly the same thing. It also works a very high speeds (upto the native sys-clk speed which is 125 MHz). Even with additional overhead from running code, reaching 100 Msps should be easily achievable. Furthermore this gives a few more advantages -

1. The whole thing is software based and comes with all the goodness of software - Easy updates and changes. Open source contribution and development prospects. Hardware independence etc.
2. High speed DACs generally have either Parallel CMOS, LVDS or JESD204B interfaces. Instead of using complex FPGA we can easily achieve all three interfaces with Pico's PIO programming and additional software. So this makes the core bit generator modular as well. So it can be adapted into other hardware.

For the current proof of concept, we have chosen to have a 8 bit DAC with a CMOS interface. Note that the Pi Pico has more than enough pins free to support higher resolutions. The connections for Pi Pico are as follow -

          GP00 -|                          |- VBUS  <--- Vin (5v)
          GP01 -|                          |- VSYS      
          GND  -|                          |-  GND      
          GP02 -|                          |- 3v3E        
          GP03 -|                          |- 3v3O  ----> 3.3V ref for level converter
          GP04 -|                          |- ADC_VREF
          GP05 -|                     ADC2 |- GP28 
          GND  -|                     AGND |-  GND
          GP06 -|          I2C1_SCL / ADC1 |- GP27
          GP07 -|          I2C1_SDA / ADC0 |- GP26
          GP08 -|                          |-  RUN
          GP09 -|                          |- GP22
D0 <----  GND  -|                          |-  GND
D1 <----  GP10 -|                          |- GP21
D2 <----  GP11 -|                          |- GP20
D3 <----  GP12 -|       SPI0_TX            |- GP19
D4 <----  GP13 -|       SPI0_SCK           |- GP18
D5 <----  GND  -|                          |-  GND  <---- Ground
D6 <----  GP14 -|       SPI0_CS / UART0_RX |- GP17  ----> UART RX
D7 <----  GP15 -|       SPI0_RX / UART0_TX |- GP16  ----> UART TX

The D0 to D7 are the digital pins outputting the bit pattern. We will use a serial console to control the whole thing which will be connected to GP16, GP17. The board will be powered via VBUS and GND. We also need a 3.3V ref since a logic level converter is necessary to convert to 5V logic level.

Design - DAC and power supply

For the DAC we have chosen a classic as well one of the most simple - DAC0808. While this DAC has a sample rate of only 6.6 Msps it is reasonably high enough for our proof of concept. It also features a parallel CMOS interface which is  staple for high speed DACs. Since the DAC requires a negative voltage supply, we have used a TC7662A charge pump.  The DAC also needs a reference...

Read more »