Here I share are the plans for the STM32based ADC version and voltmeter front-end (amps and ohms part are planed, but not yet build / final).
I have a working DVM unit with some bodges and limitations (e.g. output to PC only, no case yet). I still don't consider the project finished, but far enough to have the main parts working. A photo of the board was already shown.
Like some older MS-ADCs, the ADC is build around a µC and not a FPGA as many new designs.
The principle of the ADC and the analog circuit is still essentially the same as in the AVR based version. Different from the AVR version the code is in C and thus a little easier to modify / extend. It is still not easy to port to a much different µC, as non standard details of the timer hardware (trigger timer start from comparator) are used to do the critical timing part. With the ARM CPU the µC can already do the conversion to a decimal format and thus no special software needed on the PC side - just a terminal program.
The µC is an STM32L051 in 48 pin LQFP. A few similar types (e.g. STM32L053 or L071) should work as well. The availability of the STM32 µCs is poor, with the STM32L0xx a bit less critical so far, but still not good. The code is a mix of using the HAL libraries / cube MX environment for the initial configuration and direct register access later on. So the code has some of the cube MX specific files and most of the code in separate files.
The actual ADC control part is in the ISRs. The non interrupt code is for the UI and converting the raw result to a final number.
The front-end part of the DMM/DVM is a bit more complicated than the low end commercial designs. I have considered a simpler version (e.g. more like the Keithley 2000), but the savings are not that large. Part of the extra circuit is to include extra features.
The front end includes the possibility to do internal measurements of the gain and divider ratio both for the positive and negative sign.
To support linearity testing there are 2 inputs (needed for 4 wire ohms anyway) and also switching between 2 low sides. This allows an automated turn over and sum test. While currently only a DVM, provisions for the ohms mode (2 and 4 wire ohms) and extra internal inputs for the amps mode are included.
The extension to a 20 V (some 24 V maximum reading) range with high Z also needs a little extra HW.
To avoid special, expensive and large relays the maximum input voltage is limited to some 200 V (up to 400 V when brave) and I would not give the protection a CAT2 rating. So this is for lower power and limited voltage, more like a precision DMM, not for mains work. There are no AC ranges anyway.
The voltage ranges are for some 200 mV / 2 V / 20 V / 40 V / 200 V .
The board was planed to also work inside the BB3 measurement system - though not yet tested there and the interface part is not populated and SW still missing.
The EMI sensitivity makes a stand alone use more practical, at least for the initial tests.
The front end part could also be used with a different ADC. The first tests were done with the AVR based ADC version instead of the ADC on the board.
There should still be a bit of hardware optimization and quite some additional functions in the software needed.
The main hardware issues still to address are:
- the DCDC converter can be a source of interference. The DCDC part may need a make over anyway, as the SN6505 is hard to get.
- EMI sensitivity
- there is some extra low level (~20 nV) low frequency noise at the input. So the noise with longer integration is not as good as hoped for.
- some offset voltage drift (around 2 µV on warm up), likely from the protection part as the 2 inputs drift different.
- during start up the LM399 heater current overloads the DCDC - maybe add soft start from lower voltage (Ok for stand alone, but not good inside BB3)
- The PCB still has a few errors and needs some bodges. So I would not recommend a 1:1 copy of the layout.
- The ESD protection is likely not really good.
- additional protection with fusible resistors would be good as a last resort
The output and control so far is from the PC only, so no display or keys, but just an UART-> USB interface with a terminal program at the PC side.
So far the user interface is a bit simple: 1 letter commands with 1 digit parameters, with the digit coming first. So something for the fans of RPN calculators.
The SW has some limitations
- the control needs delay between commands (OK for manual typing, but could be annoying for a program)
- the user-interface is a bit cryptic
- the ACAL results (gain, divider, offsets) are not yet included in the result. So some of the math is still on the PC side.
- the parameters for ADC fine tuning are included at compile time. Should be added to the SW to include at run time.
- limited to 1 PLC conversions and averaging for higher resolution so far.
The schematics are as a PDF. If needed I can also provide the KiCad (5.1.8) files. This still need a bit sorting out the local parts/footprints.
The LTspice simulation is for the amplifier in gain 10 configuration (2 V range). It may help to understand the configuration with the driven low side.
The Code files are zipped (I hope all the required files to use in ST Cube MX are included). The compiler should use optimization also for debugging.
Debugging still works reasonable, as there is not that much optimization possible with many of the variable as volatile.