Driver
MCP970x Driver¶
A C++20 driver for the Microchip MCP9700, MCP9700A, MCP9700B, MCP9701 and MCP9701A analog temperature sensors, read through any MCU's ADC, with clip, noise and range checks.
The driver has no platform code. You give it a small class that reads one ADC channel in millivolts; it does the
rest: power-up timing, averaging, the clip, noise and range checks, and the transfer function in integers. Other
linear active thermistor ICs with a first-order output (V = V0 + TC x T) work through an explicit Custom variant
that you declare completely.
Analog temperature sensor
MCP9700 / MCP9700A / MCP9700B / MCP9701 / MCP9701A
Microchip
- Measures
- -40 °C to +125 °C (+150 °C with the High option on the MCP9700 and MCP9700B); -10 °C to +125 °C for the MCP9701 and MCP9701A
- Output
- 500 mV at 0 °C and 10.0 mV/°C (MCP9701 and MCP9701A: 400 mV and 19.5 mV/°C), typical
- Accuracy
- ±4 °C (MCP9700, MCP9701), ±2 °C (A grade), ±1 °C (MCP9700B, +20 °C to +70 °C), by temperature span
- Supply
- 2.3 V to 5.5 V (3.1 V to 5.5 V for the MCP9701 and MCP9701A), 6 µA typical
- Interface
- One analog output (VOUT) to an MCU ADC channel; the supply may come from an MCU pin (optional hook)
What you get¶
- One object per sensor, no I/O until
EnsureInitialized(). See API guide. - The whole family as data: one variant table, no branch on a part name, plus the explicit
Customvariant. See Configuration. - Integers only: milli-degrees and millivolts, with one optional
ToCelsius()for printing. See Transfer function. - A reading you can trust: dummy conversions, averaging, clip (
Saturated), noise (Unstable) and range (OutputLow,OutputHigh) checks, never a retry and never a clamp. See Architecture. - Errors you can act on:
Result<T>with anError. See Contract. - Zero-overhead portability: a CRTP port checked by a concept, one required hook for the ADC. See Porting.
- Tested without hardware against an independent model of the sensor and the ADC, and fuzzed. See Testing and CI. What a bench still has to confirm is in Limitations.
Datasheet¶
| Document | Revision | Get it |
|---|---|---|
| Datasheet: MCP970X Low-Power Linear Active Thermistor ICs (Microchip Technology Inc. DS20001942) | L, 2024-02 | PDF · 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.