Module mcp3204

Module mcp3204 

Source
Expand description

The Microchip Technology Inc. MCP3204 device is a successive approximation 12-bit Analog- to-Digital (A/D) Converter with on-board sample and hold circuitry. The MCP3204 is programmable to provide two pseudo-differential input pairs or four single-ended inputs.

Differential Nonlinearity (DNL) is specified at ±1 LSB, while Integral Nonlinearity (INL) is offered in ±1 LSB (MCP3204-B) and ±2 LSB (MCP3204-C) versions. Communication with the devices is accomplished using a simple serial interface compatible with the SPI protocol. The devices are capable of conversion rates of up to 100 ksps. The MCP3204 devices operate over a broad voltage range (2.7V - 5.5V). Low current design permits operation with typical standby and active currents of only 500 nA and 320 μA, respectively.

§Usage (sync)

use embedded_devices::devices::microchip::mcp3204::{MCP3204Sync, InputChannel};
use uom::si::electric_potential::{volt, millivolt};
use uom::si::f64::ElectricPotential;

// 2.5V reference
let mut mcp3204 = MCP3204Sync::new_spi(spi, ElectricPotential::new::<volt>(2.5));

let value = mcp3204.convert(InputChannel::Single0)?;
let voltage = value.get::<millivolt>();
println!("V_in at channel 0: {:?}mV", value);

§Usage (async)

use embedded_devices::devices::microchip::mcp3204::{MCP3204Async, InputChannel};
use uom::si::electric_potential::{volt, millivolt};
use uom::si::f64::ElectricPotential;

// 2.5V reference
let mut mcp3204 = MCP3204Async::new_spi(spi, ElectricPotential::new::<volt>(2.5));

let value = mcp3204.convert(InputChannel::Single0).await?;
let voltage = value.get::<millivolt>();
println!("V_in at channel 0: {:?}mV", value);

Structs§

MCP3204Async
The MCP3204 is a 12-bit ADC with on-board sample and hold circuitry. It is programmable to provide two pseudo-differential input pairs or four single-ended inputs.
MCP3204Sync
The MCP3204 is a 12-bit ADC with on-board sample and hold circuitry. It is programmable to provide two pseudo-differential input pairs or four single-ended inputs.

Enums§

InputChannel
The ADC input channel