Designing an 8-channel load-cell ADC card in KiCad

The FMC card for the MCLP core: the analog front end for eight load cells, how I checked the schematic, and how I routed the 4-layer board.

The MCLP core from part 1 needs one AD7190 converter per load cell, wired to FPGA pins. The reference design runs on AMD's ZC702 board, which has FMC connectors for mezzanine cards. So I designed an FMC card with eight converters, eight load-cell terminals and its own power for the analog side.

I routed the card in KiCad 10. It passes the electrical and design rule checks, and the fabrication files are ready. It is not ordered yet.

What the card connects to

The card plugs into FMC1 on the ZC702. The core needs 12 signals, all in one FPGA bank at 3.3 V. Four go out to the converters: the SPI clock, data-in, chip-select and SYNC. Eight data lines come back.

The ZC702 sets its FMC I/O voltage, VADJ, to 2.5 V in the factory. You must change it once to 3.3 V over PMBus with TI's Fusion tool. The README in the repository has the steps.

Power for the analog side comes from the 12 V pin on the FMC connector.

Measuring a load cell as a ratio

A load cell is a bridge that puts out a few millivolts per volt of excitation. If the excitation changes, the reading changes with it, in the same way as a change in weight. The usual fix is a ratiometric measurement. The excitation that drives the bridge also feeds the reference input of the converter. The signal and the reference then move together, and the output of the converter stays the same.

Many load cells have six wires. Two carry the excitation, two carry the signal, and two sense wires measure the excitation at the cell itself. With 6-wire cells, the card takes the reference from the sense wires. The voltage drop along the cable then also drops out of the measurement. For 4-wire cells, two solder jumpers per channel connect sense to excitation at the terminal.

The AD7190 adds one constraint: its reference must not be higher than its analog supply, AVDD. My first schematic had two regulators, one for AVDD and one for the excitation. With both regulators at the edges of their tolerance, the excitation could end up above AVDD, and the reference with it. In the design review, I moved both rails onto one ADP7118 LDO. Its output capacitor is the star point. A net tie there splits AVDD and the excitation into separate traces, so the reference can't go above the supply.

Power schematic: a TPS54202 buck from 12 V to 6.0 V, an ADP7118 LDO to 5.0 V for AVDD with a net tie to the excitation rail, and a ferrite from VADJ to DVDD

Power: a buck from the FMC's 12 V to 6.0 V, one LDO for AVDD and the excitation, and DVDD from VADJ through a ferrite.

In the worst case, the LDO must supply 168 mA. Eight converters take up to 54 mA, and eight 350 Ω bridges at 5 V take 114 mA. The LDO is rated for 200 mA. A TPS54202 buck converts the 12 V to 6.0 V first, and the LDO makes the 5.0 V from that. The digital supply of the converters comes from VADJ through a ferrite. The whole card draws about 1 W.

One channel

Schematic of one channel: a 7-pin load-cell terminal with a polyfuse and TVS on the excitation, an ESD array on the four signal and sense lines, then 100 Ω resistors and 100 nF and 10 nF filter capacitors into the AD7190 inputs and reference

One channel. The design uses the same sheet eight times, as CH0 to CH7.

Each channel starts at a 7-pin pluggable terminal. The terminal carries the excitation, sense and signal pairs, plus the cable shield, which connects to ground at the terminal. The excitation output has a polyfuse with about 100 mA hold current and a 6 V TVS diode.

All channels share the LDO. A shorted cable pulls the supply down until the polyfuse of that channel trips. The converters may reset, and the software reports the fault.

The two sense lines and the two signal lines go through a four-line ESD array right at the connector, before any other part. The array covers ESD. A long cable run on an industrial site would also need surge protection.

From there, each pair passes through the filter from the weigh-scale application in the AD7190 data sheet. Each line has 100 Ω in series. A 100 nF capacitor sits across the pair, and a 10 nF capacitor connects each line to ground. The reference pair gets the same filter as the signal pair, so both pairs see the same response.

The resistors in the reference path are 0.1%, 25 ppm thin-film parts. The reference input draws a small sampling current through them. Thus their tolerance and drift turn into a gain error. Calibration removes a fixed gain error, but not one that drifts with temperature. The signal inputs have buffers and draw no current, so 1% resistors are enough there.

Clock and SPI distribution

Interface schematic: the 4.9152 MHz oscillator into one 74AHC244 that drives eight MCLK lines through 33 Ω resistors, and a second 74AHC244 that drives SCLK, DIN, chip select and SYNC to two groups of four converters, with 10 kΩ pull-ups on its inputs

Clock and SPI distribution between the FMC connector and the eight converters.

All eight converters must sample at the same instant, so they share one clock and one SYNC line. A 4.9152 MHz oscillator drives all eight inputs of a 74AHC244 buffer. Each buffer output feeds the clock pin of one converter through 33 Ω.

A second 74AHC244 drives the SPI clock, data-in, chip-select and SYNC lines. One half drives converters 0 to 3, and the other half drives converters 4 to 7, through 33 Ω at each output. Pull-ups of 10 kΩ on the buffer inputs keep every converter deselected while the FPGA is not configured. The data output of each converter goes straight back to its own FMC pin through 33 Ω.

Checking the schematic

KiCad's electrical rule check confirms that a driver drives each input and that no pin floats. It can't tell if the correct pins connect to each other. For this card, I wrote a script to check the netlist that KiCad exports. The checker traces nets pin by pin and doesn't reuse the tables of the generator. Thus a mistake in the generator can't also hide in the check.

The checker confirms these points:

  • Every FPGA pin in the constraints file lands on the FMC pin that the ZC702 user guide gives for it.
  • That FMC pin reaches the correct AD7190 pins through the correct buffer and resistor.
  • The clock path reaches every converter.
  • Every AD7190 pin tie and decoupling capacitor is present.
  • Every part in every channel is present, and the power rails connect correctly.
  • No net has only one pin.

To make sure the checker can catch a single wrong pin, I swapped the SPI clock and chip select on one converter. The check failed, as it should.

It caught three real problems:

  1. Two sheets both used R10 and R11. One sheet used them as clock series resistors, and the other as the feedback divider of the buck. ERC passed, but KiCad merged each pair into one net. The trace found the clock path through 100 kΩ and 11.0 kΩ.
  2. The first "Update PCB from Schematic" gave 36 errors on the FMC connector. The Samtec footprint names its pads C01 to C40, and my symbol used C1 to C40. So pins 1 to 9 of each row had no matching pad. The checker now compares the pin names of every part with the pad names of its footprint.
  3. During routing, I found that the pass-through pads of the ESD array were marked as no-connects. With this part, a signal can run straight across from one pad to the opposite pad. That only works if both pads are on the same net. They now are, and the checker verifies each pair.

I also learned that a net label in KiCad must sit exactly on the grid that the wires snap to. A label slightly off the grid splits the net without a warning. Three nets had this problem. A comparison of the netlists before and after a redraw found them.

Stackup and rules

The board has four layers on JLCPCB's JLC04161H-7628 stackup. The top layer carries the parts and the analog routing. The first inner layer is a solid ground plane over the whole board, with no traces on it. The second inner layer carries the power rails, with ground fill around them. The bottom layer carries the digital buses and the fan-out of the FMC connector.

The board has no impedance control. The fastest signals are a 4.9 MHz clock and the SPI lines. At those speeds, trace impedance doesn't matter. The finish is ENIG, because the 0.5 mm pitch ESD arrays and the small LDO package solder better on flat pads. The clearances are 0.2 mm, because the ESD arrays and the LDO have only 0.2 mm between their own pads.

Routing

The layout follows the signal flow. The FMC connector sits on the left edge, on the bottom side, so the card hangs over the ZC702. The terminals for CH0 to CH3 line the top edge, and the terminals for CH4 to CH7 line the bottom edge. Each converter faces its analog pins toward its terminal. Its digital pins face the middle of the board, where the buses and the power section are. Eight terminal blocks at 24.5 mm each need the edge length, so the card is larger than a standard single-width FMC card.

KiCad 3D render of the finished card from the top: four green terminal blocks along the top edge for CH0 to CH3, four along the bottom edge for CH4 to CH7, an AD7190 behind each terminal, the clock and SPI buffers at the left and the power section in the middle

The finished card in KiCad's 3D viewer. The FMC connector is on the bottom side, under the left edge.

I routed the board by hand in KiCad.

Routing in KiCad, sped up.

The ground plane stays whole, so every trace on the top layer has a return path right under it. Where a power trace must cross another trace, it uses a short jumper on the top layer instead of a cut in the plane. Every ground pad has its own via. Stitching vias run along the board edge every 8 mm.

Each analog pair runs side by side from the terminal through its filter to the converter, with the parts placed as mirror images. Both lines then pick up the same noise and stay at the same temperature.

KiCad 3D render of CH4 to CH6: each terminal at the bottom, the jumpers and filter resistors and capacitors above it in mirrored pairs, and the AD7190 above them, with the buck converter, its inductor and the LDO above CH5 and CH6

CH4 to CH6, with the power section above them. The filter parts of each pair sit as mirror images between the terminal and the converter.

The temperature matters at gain 128. A temperature difference between the two lines of a pair shows up as an offset of about a microvolt, which is more than the noise of the converter. For the same reason, the analog pairs keep away from the buck converter and the LDO. The pairs are not length-matched. The signals change slowly, and a meander would only add loop area.

Digital lines never run alongside analog lines. Where they must cross, they cross at right angles on another layer, with the ground plane between them. The buses run on the bottom layer, 0.2 mm wide at 0.6 mm pitch, with the series resistors at the driver end. The switching loop of the buck is small, and it sits on the side of the board away from the analog inputs.

Routing showed a few placement mistakes. Some parts faced the wrong way. The TVS, a jumper and two filter capacitors put a ground pad on a signal line or made the excitation cross a sense line. The buck inductor had its switching pad away from the regulator. I turned all of them 180 degrees.

The finished board has 0 ERC errors, 0 DRC violations, 0 unconnected items and 0 differences from the schematic. A KiCad jobset runs both checks in one step. The same step writes the Gerbers, drill files, BOM, placement file and a schematic PDF.

Before ordering

A few points need confirmation against real parts first:

  • the exact Samtec part number and stack height of the FMC connector, against the connector on the ZC702
  • the outline and mounting holes, against the parts around the card
  • the behavior of the buck converter at light load, its output capacitance at 6 V of DC bias and its loop stability
  • the SPI clock edge at the farthest converter, because one buffer output drives the clock to four converters (the fallback is a third buffer for point-to-point clocks)
  • the ordering codes for the fixed 5.0 V LDO and the oscillator

The KiCad project and the fabrication files are in hw/adc-card. Part 3 shows how I tested the software against the RTL without any hardware.

PCB design · KiCad · Analog front end · Load cells · FMC

Available · Asia/Dhaka (UTC+6)

Have hardware that needs to work?

Tell me what you're building. I'll come back with questions, a rough scope and an estimate, usually within 2 days.

PAD 01 · I/O