Debugging/Analog Output

It is desirable to have a method for the real-time visualisation of digital quantities within the system. An analogue output will allow internal variables to be viewed with an oscilloscope. A few methods are compared:

  • MCU on-chip PWM followed by a passive low-pass filter (LPF). This can only produce a unipolar signal, so a bipolar op-amp configured as a differential amplifier (voltage) subtractor must be used, where the two PWM signals form the differential input to the op-amp.
  • MCU on-chip DAC driving bipolar op-amp. This is similar to the above method however the two PWM signals fed through a LPF can be replaced with an on-chip DAC and mid-scale voltage reference to subtract. A limitation of this method is the F28377S MCU only has three DAC outputs.
  • MCU SPI driving unipolar DAC which drives a bipolar op-amp. This is similar to the above method with the on-chip DAC being replaced with a dedicated external DAC. The main advantage of this four DAC outputs can be obtained.
  • MCU SPI driving external bipolar DAC (preferred). This eliminates the need for an op-amp to create the bipolar output, and the need for an accurate mid-scale voltage reference to adjust the zero voltage level of the signal. Analog Devices AD5724R, AD5734R, and AD5754R quad channel bipolar DACs with an internal voltage reference. The difference between these three chips is the resolution, being 12-bit, 14-bit, and 16-bit respectively.