Circuit review & bench-test guide
AXS-017 — LSM6DSM 6-axis IMU PMOD module
Document purpose#
This document explains the axs-017-lsm6dsm prototype at component level and turns the design evidence into a practical manual-review and bench-test plan. It is based on the authoritative design sources in this directory: generate_design.py (the schematic generator), README.md, and the generated axs-017-lsm6dsm.kicad_sch.
The board is a design-stage prototype. Repository status is: schematic generated, ERC clean (0/0), netlist reviewed, PCB layout not started, not released. No board has been fabricated or assembled, so there is no first-article evidence of any kind. Every value below is a design target to verify on real hardware, not proof that an assembled module works.
1. What the board does#
The board is a 12-pin PMOD Type 2A (expanded SPI) sensor module carrying an STMicroelectronics LSM6DSM 6-axis IMU (3-axis accelerometer plus 3-axis gyroscope) in 4-wire SPI mode. VDD and VDDIO are both fed from the 3V3 PMOD rail. INT1 and INT2 are routed to PMOD pins 7 and 8 through series resistors. The auxiliary (OIS/mode 3/4) SPI interface is deliberately unused.
It contains no regulator, level shifter, or protection beyond series resistors: the host defines the supply quality and the logic levels. Nothing on the module proves the sensor is calibrated or that its data is trustworthy; that requires the register-level bring-up and self-test below.
Functional block diagram#
PMOD J1 (Type 2A, 3.3 V) LSM6DSM U1 (LGA-14)
1 CS_N ──────────────┬─────────────> pin 12 CS (R4 10k pull-up to 3V3)
2 MOSI ─────────────────────────────> pin 14 SDA/SDI
4 SCK ─────────────────────────────> pin 13 SCL/SPC
3 MISO <──────R1 100R─────────────── pin 1 SDO/SA0
7 INT1 <──────R2 100R─────────────── pin 4 INT1
8 INT2 <──────R3 100R─────────────── pin 8 INT2
6/12 3V3 ──┬── C1 100n ── VDD (pin 8*) * schematic supply pins
└── C2 100n ── VDDIO (pin 5)
5/11 GND ─────────────── GND (pins 6, 7)
Aux port: OCS_Aux (pin 10) ── 3V3; SDx (2), SCx (3), SDO_Aux (11) open
2. Safety and scope boundaries#
- This is a low-voltage 3.3 V logic module, but it has no reverse-polarity or overvoltage protection. A miswired bench supply or an incorrectly keyed PMOD cable can destroy U1 (VDD absolute range ends at 3.6 V).
- Power the module from 3.3 V only. Do not connect 5 V PMOD-lookalike hosts or 5 V logic adapters. Verify adapter IO voltage before attach.
- Do not hot-plug the PMOD connector with the host powered; PMOD has no make-first ground guarantee in typical ribbon setups.
- ESD-safe handling is required: U1 is an exposed LGA MEMS part on an unprotected connector.
- Do not drop or tap the module with hard tools to "test" the accelerometer; MEMS shock ratings are finite. Use gentle orientation flips and the built-in electrical self-test instead.
- A passing WHO_AM_I and self-test is not calibration, EMC, vibration, or environmental qualification. This guide covers first-article bring-up only.
3. Power and control sequence#
- 3V3 is applied on J1 pins 6/12. C1 and C2 supply local decoupling for VDD and VDDIO. There is no sequencing requirement between them here because both are the same net.
- R4 (10 kΩ to 3V3) holds CS high while the host is unconfigured. Per the datasheet, CS = 1 means "SPI idle mode / I2C communication enabled"; the pull-up guarantees the part never sees a floating CS and cannot latch a spurious SPI transaction during host FPGA configuration.
- The LSM6DSM boots; datasheet turn-on time is 35 ms. Do not expect valid register traffic before that.
- The first SPI access with CS driven low uses the SPI protocol; because CS idles high, I2C remains theoretically possible until the first SPI transaction. Disabling I2C afterwards (CTRL4_C, I2C_disable bit) is a recommended firmware step, not a hardware feature of this board.
- Sensor-driven lines (SDO to MISO, INT1, INT2) each pass through 100 Ω series resistors (R1-R3), limiting current in pin-contention or hot-plug fault cases and damping reflections on ribbon cables.
Why the CS pull-up matters#
Pin 12 (CS) selects the interface: 1 = I2C enabled/SPI idle, 0 = SPI active. An unconfigured ECP5 leaves PMOD pins high-impedance; without R4, CS floats and noise can clock garbage into the part or leave it half-selected. With R4 the part sits deselected until the host deliberately drives CS low.
4. Interfaces and usage contexts#
| PMOD pin | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Net | ~CS | MOSI | MISO | SCK | GND | 3V3 | INT1 | INT2 | NC | NC | GND | 3V3 |
The bench plan below covers two usage contexts; every powered test states which one it assumes:
- Context A — PMOD host FPGA: plugged into a 3.3 V PMOD port of an ULX3S-class ECP5 host. The FPGA provides 3V3/GND and drives CS/MOSI/SCK. Useful for the real streaming lesson, but the FPGA is also an unknown in first bring-up.
- Context B — standalone bench: module on a bench supply (3.3 V, current-limited to ~50 mA) with SPI driven by a lab MCU or USB-SPI adapter (e.g. FT2232H/Bus Pirate at 3.3 V). Preferred for first power-on because every signal is observable and the host is known-good.
SPI parameters (from the datasheet, Table 6): mode 0 or mode 3 (data driven on SPC falling edge, captured on rising edge; SPC idles high with CS high, which is the mode 3 description), maximum SPC clock 10 MHz. Start bring-up at 0.5-1 MHz and raise the clock only after transactions are clean. I2C fallback: the silicon supports I2C (100/400 kHz, slave address 110101x where x = SA0 = SDO pin level), but this board provides no I2C pull-ups and SDO carries R1 in series, so I2C use would need external pull-ups on PMOD pins 2 (SDA) and 4 (SCL) and is not a designed-in mode.
5. Component-by-component review#
Complete reference-designator list from generate_design.py: J1, U1, C1, C2, R1, R2, R3, R4 (plus ERC-only power flags #FLG01/#FLG02, which place no parts). All eight physical references are reviewed below.
| Ref. | Part / datasheet summary | Function and why needed | If absent/open | If shorted, wrong, or misassembled |
|---|---|---|---|---|
| J1 | 12-pin PMOD Type 2A plug | Carries 3V3, GND, 4-wire SPI, INT1/INT2 to the host; pins 9/10 NC | No power or communication | Reversed/offset insertion swaps power and signals; a 5 V host destroys U1 |
| U1 | ST LSM6DSMTR, LGA-14 3x2.5 mm 6-axis IMU | The entire sensing function: accel + gyro, 4 kB FIFO, programmable interrupts | Board is inert | Wrong orientation on LGA-14 is a hard failure; poor paste on the small pads gives intermittent SPI; overheated rework degrades MEMS performance |
| C1 | 100 nF 16 V X7R 0603 (Murata GRM188R71C104KA01D) | VDD decoupling; the datasheet application hints specify 100 nF ceramic at the supply pins | Supply bounce during ODR transitions; marginal SPI/ADC behavior | A short is a 3V3-GND short; wrong (much larger) value is harmless here but masks the intent |
| C2 | 100 nF 16 V X7R 0603 (same MPN) | VDDIO decoupling per the same datasheet hint | IO-edge noise couples into the supply; marginal timing at 10 MHz | Same as C1 |
| R1 | 100 Ω 1% 0603 (Yageo RC0603FR-07100RL) | Series protection/damping on the sensor-driven SDO-to-MISO line | MISO connects directly; loss of contention protection only | Open = MISO reads all-0/all-1, WHO_AM_I fails; wrong high value degrades 10 MHz timing (RC with bus capacitance) |
| R2 | 100 Ω 1% 0603 | Series protection on INT1 to PMOD pin 7 | Same protection loss | Open = no data-ready/event interrupts on INT1; polling still works |
| R3 | 100 Ω 1% 0603 | Series protection on INT2 to PMOD pin 8 | Same | Open = no INT2 events; polling still works |
| R4 | 10 kΩ 1% 0603 (Yageo RC0603FR-0710KL) | CS idle pull-up so an unconfigured host cannot leave CS floating (part would sit in an undefined select state) | CS floats before FPGA configuration; spurious transactions possible | Short to 3V3 means the host must fight 0 Ω to select the part — SPI never works; wrong low value loads the host driver |
5.1 Auxiliary-port strap review (board-specific)#
The LSM6DSM has a second (auxiliary) SPI port used in modes 3/4 for OIS or as sensor-hub wiring. This board uses mode 1 (single host SPI) and straps the aux pins as follows. Datasheet pin table (Table 2, DocID028165 Rev 7) is the reference; two straps deviate from its letter and must be consciously accepted or changed at layout review.
| Pin | Name | Aux-port role (mode 3/4) | Datasheet says (mode 1) | This board | What goes wrong if mis-strapped |
|---|---|---|---|---|---|
| 10 | OCS_Aux | Auxiliary SPI enable (chip select) | "Leave unconnected (electrically unconnected, soldered to PCB)" | Tied to VDDIO | If strapped low, the aux SPI port is enabled/selected: SDO_Aux can drive, and the aux state machine is live while the primary port is in use. Tying it high forces "deselected", which is functionally safe but is a documented deviation from the mode-1 pin table |
| 2 | SDx | Aux SDI (4-wire) / SDIO (3-wire) | "Connect to VDDIO or GND" | Open (no-connect) | An open digital input can float mid-rail; the design comment argues the pad is gated while the aux interface is disabled and cites ST STEVAL practice. If that gating assumption is wrong, expect microamp-level shoot-through or erratic aux behavior. Verify against the STEVAL-MKI189V1 schematic before layout release |
| 3 | SCx | Aux SPC (clock) | "Connect to VDDIO or GND" | Open (no-connect) | Same exposure as SDx |
| 11 | SDO_Aux | Aux 4-wire data output | "Connect to VDDIO or leave unconnected" | Open | Compliant. Shorting it to GND while aux mode were ever enabled would fight the output driver |
Review disposition: OCS_Aux = VDDIO guarantees the aux port can never be selected, which is arguably safer than floating, but both the OCS_Aux tie and the open SDx/SCx contradict the datasheet's mode-1 text. This is flagged as an open review item: either document the STEVAL evidence in the repo or move SDx/SCx to VDDIO/GND straps at layout time.
6. Datasheet summary and design interpretation#
Facts below were taken from the STMicroelectronics LSM6DSM datasheet, DocID028165 Rev 7 (official URL: <https://www.st.com/resource/en/datasheet/lsm6dsm.pdf>; product page: <https://www.st.com/en/mems-and-sensors/lsm6dsm.html>). Note on sourcing: st.com timed out repeatedly during this review, so the identical Rev 7 PDF was retrieved through the Internet Archive copy of that exact st.com URL. Re-verify against the live st.com revision before release.
| Datasheet fact (Rev 7) | Value | Board-specific interpretation |
|---|---|---|
| VDD supply range | 1.71-3.6 V (1.8 V typ) | 3.3 V PMOD rail is in range but nearer the top; the 3.6 V ceiling is why 5 V hosts/adapters are forbidden |
| VDDIO range | 1.62-3.6 V | VDD = VDDIO = 3V3 is a supported configuration |
| Current, accel+gyro high-performance | 0.65 mA @ 1.6 kHz ODR | Expect single-digit mA total board draw; more indicates a fault |
| Turn-on time | 35 ms | Do not test registers immediately after power |
| SPI | Mode 0/3, fc(SPC) max 10 MHz, 16-clock read/write frames, bit 0 = RW (1 = read), bits 1-7 = address, MSb-first data | Defines the exact bring-up bytes in section 9.C |
| I2C | 100/400 kHz, SAD 110101x (0x6A/0x6B with SA0) | Fallback only with external pull-ups; not designed-in |
| WHO_AM_I (0Fh) | Fixed value 6Ah | First-transaction pass criterion |
| CTRL5_C (14h) | ST_G[1:0] gyro self-test (01 positive, 11 negative, 10 not allowed); ST_XL[1:0] accel self-test (01 positive, 10 negative, 11 not allowed) | Drives the self-test procedure in 9.D |
| Accel self-test output change | 90-1700 mg absolute change, full-scale independent | Pass window for 9.D |
| Gyro self-test output change | 20-80 dps at FS = 250 dps; 150-700 dps at FS = 2000 dps | Pass window for 9.D |
| ODR ranges | Accel 1.6 Hz-6.66 kHz; gyro 12.5 Hz-6.66 kHz | Bounds the streaming tests |
| FIFO | 4 kbyte, dynamic allocation | The module's curriculum feature; FIFO_CTRL1-5 at 06h-0Ah |
| Decoupling | 100 nF ceramic at supply pins (application hints, Fig. 17) | C1/C2 match |
| Logic levels | VIH >= 0.7 VDD_IO, VIL <= 0.3 VDD_IO, 4 mA max pad drive | 3.3 V LVCMOS on ECP5 is compatible; do not parallel heavy loads on MISO |
| Aux pins (Table 2) | SDx/SCx "connect to VDDIO or GND"; OCS_Aux "leave unconnected"; SDO_Aux "VDDIO or unconnected" | See section 5.1 deviations |
7. Expected values before bench testing#
| Quantity | Design target | How to check |
|---|---|---|
| 3V3-to-GND resistance, unpowered | High (>10 kΩ class, both polarities) | DMM at J1 pins 6-5 |
| CS_N idle level | 3.3 V via R4 | DMM at J1 pin 1, host tristated |
| Supply current after boot, defaults | <= ~1 mA (device powers up with sensors off; 0.65 mA once both sensors at high-performance) | Bench supply readout, Context B |
| WHO_AM_I (0Fh) | 0x6A | Section 9.C byte sequence |
| Accel at rest, FS ±2 g | one axis ~±1 g, others ~0 g (±40 mg zero-g class typical) | OUTX/Y/Z_A registers |
| Gyro at rest, FS ±250 dps | ~0 dps, within a few dps offset | OUTX/Y/Z_G registers |
| Accel self-test delta | 90-1700 mg | Section 9.D |
| Gyro self-test delta (FS 2000) | 150-700 dps | Section 9.D |
| INT1/INT2 data-ready toggling | at programmed ODR | Scope on J1 pins 7/8 |
| SPI signal quality at 10 MHz | Monotonic edges, no double-clocking | Scope on SCK/MISO at U1 |
8. Manual schematic and assembly review checklist#
- Confirm U1 pin-1 orientation against the LGA-14 footprint dot before and after reflow; X-ray or angled-light inspect the perimeter pads.
- Verify VDD (pin 8) and VDDIO (pin 5) both reach 3V3 and GND pins 6/7 are both soldered — a single open GND pad may still "work" intermittently.
- Verify the section 5.1 straps as built: OCS_Aux to 3V3, SDx/SCx/SDO_Aux open, and record the deviation disposition.
- Measure R1-R4 values in-circuit before first power (R4 reads ~10 kΩ from CS_N to 3V3; R1-R3 read 100 Ω across their pads).
- Confirm C1/C2 placement is adjacent to U1 supply pins in layout review (layout does not exist yet — this is an open item, not a done item).
- Buzz all 12 J1 pins to their nets; especially confirm pins 9/10 are truly unconnected and pins 5/11 GND are common.
- Confirm no solder bridge between U1 pins 12/13/14 (CS/SPC/SDA are adjacent on the package edge).
9. Ordered bench-test procedure#
Stop at the first abnormal result. Record board serial, host identity, adapter/firmware versions, supply settings, and raw captures.
A. Unpowered inspection and resistance tests#
- Complete the section 8 checklist under magnification.
- Measure 3V3-to-GND resistance in both polarities; investigate any reading under ~1 kΩ before applying power.
- Verify CS_N-to-3V3 reads ~10 kΩ (R4) and MISO-to-U1 SDO reads ~100 Ω (R1).
B. First power, standalone (Context B)#
- Bench supply 3.3 V, current limit 50 mA, module only — no host signals.
- Apply power; expect quiescent current in the sub-mA range and no heating.
- Probe CS_N (3.3 V), MISO/INT1/INT2 (defined levels, not oscillating).
- Wait >= 35 ms (turn-on time) before any transaction.
C. First transaction bring-up: WHO_AM_I (Context B, then A)#
SPI settings: mode 0 or mode 3, 1 MHz to start, MSb first, CS active low.
Exact byte sequence (read of register 0Fh with the read bit set — the first transferred byte is RW=1 followed by address 000 1111b, i.e. 0x80 | 0x0F):
| Direction | Byte 1 | Byte 2 |
|---|---|---|
| Host sends (MOSI) | 0x8F | 0x00 (don't care) |
| Sensor returns (MISO) | 0xXX (undefined/hi-Z turnaround) | 0x6A |
- Assert CS low, clock the two bytes, deassert CS. Expected response: the second byte is 0x6A. Any other value: see section 10.
- Repeat 100 times; require 100/100 identical results before proceeding.
- Raise SCLK stepwise (2, 5, 10 MHz); require clean 0x6A at each step. 10 MHz is the datasheet maximum — do not test beyond it.
- Optional hygiene: write CTRL4_C to set the I2C_disable bit so a noisy SCL edge can never be misread as I2C once SPI is proven.
- Context A repeat: plug into the ECP5 PMOD port and run the same WHO_AM_I loop from fabric (or a passthrough bridge). A pass in B and fail in A isolates the problem to the host, cable, or FPGA constraints file.
D. Self-test procedure (accel and gyro)#
Per datasheet CTRL5_C (14h) and the module-specification self-test limits. Keep the module stationary and flat for the whole test.
Accelerometer (limits are full-scale independent; use FS = ±2 g):
- Configure: CTRL1_XL (10h) = ODR 52-416 Hz, FS ±2 g. Wait for output to settle; average >= 5 samples per axis: baseline OUT_A.
- Write CTRL5_C ST_XL[1:0] = 01 (positive-sign self-test). Wait for stable output; average >= 5 samples per axis: self-test OUT_A.
- Compute |ST - baseline| per axis (1 LSb = 0.061 mg at ±2 g). Pass window: 90 mg <= delta <= 1700 mg on every axis.
- Optionally repeat with ST_XL = 10 (negative sign). ST_XL = 11 is not allowed. Restore ST_XL = 00.
Gyroscope (use FS = ±2000 dps for the wide window):
- Configure: CTRL2_G (11h) = ODR 208 Hz, FS ±2000 dps. Average >= 5 samples per axis: baseline OUT_G.
- Write CTRL5_C ST_G[1:0] = 01 (positive sign). Average again.
- Compute |delta| per axis (1 LSb = 70 mdps at ±2000 dps). Pass window: 150 dps <= delta <= 700 dps per axis (20-80 dps if run at ±250 dps).
- ST_G = 10 is not allowed; 11 is negative sign. Restore ST_G = 00.
E. Data, interrupt, and FIFO checks (Context A primary)#
- Static orientation test: place each axis up and down; expect ~±1 g on the vertical axis and ~0 g on the others (FS ±2 g).
- Enable data-ready on INT1 (INT1_CTRL, 0Dh); scope J1 pin 7 and confirm pulses at the programmed ODR. Repeat for INT2 (INT2_CTRL, 0Eh).
- Configure the FIFO (FIFO_CTRL1-5, 06h-0Ah) for accel+gyro at a moderate ODR; verify FIFO fill level advances and burst reads return plausible, continuous data with IF_INC = 1 multi-byte reads.
- Sustain a burst-read loop at 10 MHz for >= 10 minutes in the ECP5 host; log CRC/consistency of samples and any WHO_AM_I re-check failures.
F. Release-only tests#
Temperature sweep, vibration/shock characterization, long-duration bias stability, EMC, and soldering-profile requalification are out of scope for this bench guide and remain open until a real layout and first article exist.
10. Troubleshooting map#
| Symptom | First measurements | Likely areas |
|---|---|---|
| WHO_AM_I reads 0x00 | MISO level at U1 pin 1 vs after R1; CS reaching U1 | R1 open, MISO solder, CS not reaching pin 12, part not powered |
| WHO_AM_I reads 0xFF | MISO stuck high; pull-up fight | MISO short to 3V3, wrong SPI mode/phase, MISO pin unsoldered at host |
| WHO_AM_I wrong but stable | Bit alignment on scope | SPI mode mismatch (use 0 or 3), off-by-one clock, MSb/LSb order |
| Works at 1 MHz, fails at 10 MHz | SCK/MISO edges at U1 | Cable length/ringing, R1 + bus capacitance, host input timing |
| No response in Context A only | Constraint/pin report of FPGA | FPGA pinout, IO standard/pull settings, PMOD orientation |
| Self-test delta out of window | Repeat stationary, both signs | Mounting stress, wrong FS/LSb conversion, part damage — do not ship |
| INT1/INT2 never pulse | Register readback of INT1_CTRL/INT2_CTRL | R2/R3 open, interrupt routing config, latched-vs-pulsed mode |
| Random resets / bad data bursts | 3V3 ripple at C1/C2 during streaming | Decoupling solder, supply droop, ground return through one GND pin |
| I2C attempted but dead | Pull-ups present? | Board has no I2C pull-ups by design; R1 in SDO path also not an I2C net |
11. Bench record template#
| Field | Record |
|---|---|
| Board revision / serial | |
| Context (A: host+bitstream ID / B: adapter ID) | |
| Supply source, voltage, current limit | |
| Unpowered resistance results | |
| First-power current draw | |
| WHO_AM_I result and SCLK sweep results | |
| Accel self-test deltas per axis (mg) | |
| Gyro self-test deltas per axis (dps) | |
| Orientation test results | |
| INT1/INT2 observation | |
| FIFO/streaming soak result | |
| Aux-strap deviation disposition | |
| Deviations, photos, raw-file paths | |
| Reviewer / date / disposition |
12. Review conclusion#
The design is a deliberately minimal mode-1 SPI carrier for the LSM6DSM, and its support network (100 nF on each supply, CS pull-up, 100 Ω series resistors on all sensor-driven lines) matches the datasheet's application hints. The principal open risks are: (1) no fabricated first article exists, so nothing here is demonstrated; (2) the aux-port straps (OCS_Aux tied to VDDIO, SDx/SCx left open) deviate from the datasheet's mode-1 pin table and rest on an STEVAL-precedent argument that is not yet evidenced in this repository; (3) PCB layout — decoupling placement, SPI trace lengths for 10 MHz, and mechanical mounting stress on the MEMS — has not been started; and (4) datasheet facts were verified against an archived copy of the Rev 7 PDF because st.com was unreachable, so the live revision must be re-checked before release.