This is a P8X32A/Propeller driver object for the Microchip MCP320x and MCP300x series ADCs
IMPORTANT: This software is meant to be used with the spin-standard-library (P8X32A) or p2-spin-standard-library (P2X8C4M64P). Please install the applicable library first before attempting to use this code, otherwise you will be missing several files required to build the project.
- SPI connection at 1MHz (P1), up to 1.8MHz (P2)
- Read channels 0..7 (availability dependent on model)
- Read raw ADC counts or voltage
- Set reference voltage (in microvolts) from 2.7v to 5.5v
- Set ADC resolution (explicitly, or implicitly by model number)
P1/SPIN1:
- 1 extra core/cog for the PASM SPI engine (none if bytecode engine is used)
- signal.adc.common.spinh (provided by spin-standard-library)
P2/SPIN2:
- p2-spin-standard-library
- signal.adc.common.spin2h (provided by p2-spin-standard-library)
Processor | Language | Compiler | Backend | Status |
---|---|---|---|---|
P1 | SPIN1 | FlexSpin (6.9.4) | Bytecode | OK |
P1 | SPIN1 | FlexSpin (6.9.4) | Native/PASM | Runs, but buggy |
P2 | SPIN2 | FlexSpin (6.9.4) | NuCode | Runs, but buggy |
P2 | SPIN2 | FlexSpin (6.9.4) | Native/PASM2 | OK |
(other versions or toolchains not listed are not supported, and may or may not work)
- Tested with MCP3002, MCP3202, MCP3208
- Single-channel models untested
- Differential modes not yet supported
- Models with other than 10 or 12 bit resolution not yet supported