Close

Software Update

A project log for STM32G4 DAQ

A DAQ with 8 Diff/16 Sin. Ended +/- 12V input channels and four +/- 12V output channels using the STM32G4

notblackmagicNotBlackMagic 12/09/2020 at 09:300 Comments

Over the past few months, I changed many small things in both the STM32G4DAQ Firmware as well as on the PC Software side.

Firmware

On the firmware side the Analog Output software handling was improved. The already used circular buffers that feed the DACs through DMAs were moved from the main SRAM1 to the smaller and separate SRAM2. This change allows for the processor to access and process data from SRAM1 simultaneously with the DMA accessing the circular buffers in SRAM2. This removes concurrent memory access wait states and therefore performance of the main code execution.

The other change to the firmware was adding the control and acquisition for the Analog Input Block B. Now both the Analog Input Block A and B can be used, simultaneously, which allows for two full speed acquisition channels of up to 62.5 ksps or up to 8 differential, 16 single ended, acquisition channels.

PC Software

On the PC Software side, the main change was switching the graphing library from the previously used LiveChart to the open source ScottPlot which is simpler and much much faster. For an idea of how much faster, with LiveCharts, it was difficult to get Graph refresh rates of 1 Hz when displaying big swing, full range, graphs. With ScottPlot this is now easily possible, currently I'm using a refresh rate of 10Hz which works very well and can be increased (drawing 2 sets/plots of 512 points each).

The other addition was the needed new Tab for controlling the Analog Input Block B, as well as adding the funcitonality of changing Graphs line colors. This new Tab as well as the new look of the graphs using ScottPlot is visible in the image bellow, it also shows the drawing speed of ScottPlot:

Next steps will be focused on discovering the cause of the still present spikes in the acquired signals as well as working on the Digital IO port. A new Analog Output OpAmp will also soon be tested, as soon as it arrives.

As always, all this and more can be found on the website. A new addition, not shown here, is the interface protocol used to control and communicate with the DAQ. I also try to give more frequent and smaller updates over on Twitter.

Discussions