Arduino与Proteus仿真实例-MCP3421ADC驱动仿真

MCP3421ADC驱动仿真

1、MCP3421介绍

MCP3421 ADC 可用于以易用性、低功耗和小尺寸为主要考虑因素的各种高精度模数数据转换应用。 MCP3421 是一款单通道低噪声、高精度 delta-sigma A/ D 转换器具有差分输入和高达 18 位分辨率的小型 SOT-23-6 封装。请考虑分辨率高达 16 位的 MCP3425 版本。板载精密 2.048V 参考电压可实现 ±2.048V 的差分输入范围。该器件使用两线 I2C™ 兼容接口,采用 2.7V 至 5.5V 的单电源供电。 MCP3421 ADC 以每秒 3.75、15、60 或 240 个样本的速率执行转换,相应的分辨率为 18、16、14 和 12 位。板载可编程增益放大器 (PGA) 提供高达 8 倍的增益。该设备有两种转换模式:连续模式和一次性模式。在 One-Shot 模式下,设备经过一次转换后自动进入低电流待机模式,大大降低了功耗。

在这里插入图片描述
在这里插入图片描述

2、仿真电路原理图

在这里插入图片描述

3、仿真代码实现

本次使用到如下开源库:

演示代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

// Include libraries this sketch will use
#include <Wire.h>
#include <MCP342X.h>

// Instantiate objects used in this project
MCP342X myADC;

void setup() {
Wire.begin(); // join I2C bus
TWBR = 12; // 400 kHz (maximum)

Serial.begin(9600); // Open serial connection to send info to the host
while (!Serial) {} // wait for Serial comms to become ready
Serial.println("Starting up");
Serial.println("Testing device connection...");
Serial.println(myADC.testConnection() ? "MCP342X connection successful" : "MCP342X connection failed");

myADC.configure( MCP342X_MODE_CONTINUOUS |
MCP342X_CHANNEL_1 |
MCP342X_SIZE_16BIT |
MCP342X_GAIN_1X
);

Serial.println(myADC.getConfigRegShdw(), HEX);

} // End of setup()

void loop() {
static int16\_t result;

myADC.startConversion();
myADC.getResult(&result);

Serial.println(result);
delay(500);

} // End of loop()


4、仿真结果

在这里插入图片描述

文章来源: https://iotsmart.blog.csdn.net/article/details/121642984