Driver
MAX22200 Driver¶
A C++20 driver for the Analog Devices MAX22200 and MAX22200A octal solenoid and motor drivers. It starts the chip with the datasheet's procedure, switches channels with one 8-bit write (one transfer per switch), programs HIT and HOLD in milliamps or percent, and reads the faults, on any MCU.
The driver has no platform code. You give it a small class that moves bytes and drives CMD and ENABLE; it does the rest: the programming procedure, the two-phase register access, the unit conversions, the read-back of every register at start-up, and the fault registers of both parts.
- Function
- Eight push-pull half-bridges, 200 mΩ, up to 1 A RMS each; HIT then HOLD per channel
- Regulation
- Current (CDR, 7-bit, IFS from RREF, low side) or voltage (VDR, PWM duty in 1 % steps)
- Configurations
- Low side, high side, parallel pairs, full bridges for latching valves and DC motors
- Diagnostics
- OCP, open load, HIT current not reached, plunger movement, overtemperature, UVLO, SPI clock count
- Interface
- SPI mode 0, up to 10 MHz; a command byte with CMD high, then 8 or 32 bits; ENABLE, FAULT, TRIGA/TRIGB
- Supply
- VM 4.5 V to 36 V; logic inputs 6 V absolute maximum, 1.2 V high
What you get¶
- One object per chip.
MAX22200<YourPort>takes a reference to your port and does no I/O untilEnsureInitialized(). See API guide. - Errors you can act on. Every call returns
Result<T>with anErrorsuch asBus,ChannelsActiveorDeviceReset. See API guide. - Datasheet codes, checked.
Config{}holds the reset values of STATUS and every channel; the conversions refuse a current that would round to the unregulated code and a HIT time that would round to "forever". See Drive modes. - A fast hot path. Switching is one 8-bit write, one transfer after another switch; a read-back is there per call when you want it. See API guide.
- Zero-overhead portability. The port is a CRTP class checked by a concept: the bus, CMD and ENABLE and a delay, plus optional FAULT-pin and logging hooks found at compile time. See Porting.
- No heap, no exceptions, no RTTI. The host tests build with
-fno-exceptions -fno-rtti. See Contract. - Tested without hardware, and honest about it. Host tests and a fuzzer run the driver against a protocol model of the chip; nothing is verified on hardware yet. See Status and limitations.
Datasheet¶
| Document | Revision | Get it |
|---|---|---|
| Datasheet: MAX22200/MAX22200A 36V, 1A Octal Integrated Serial-Controlled Solenoid and Motor Driver (Analog Devices 19-100531) | 1, 2025-03 | vendor page |
Written against these revisions; the SHA-256 of each file is in docs/datasheets.yml. Where each part
of the driver is in the datasheet: Datasheet map.
Where to go next¶
-
Wire the chip, write the port, open a valve in about 20 lines.
-
Pins, bus settings, timing and power.
-
What the driver promises, what it needs, threading and errors.
-
Start, switch, configure, read faults and handle errors, task by task.
-
Implement the port for your MCU.
-
Every class and member, generated from the headers.