1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
参照官网提供的CN0384_cn资料,做了个6通道的热电偶测量,但是调试代码的时候发现,每个通道的测量值都不对,是哪里没有设置好么?
AIN0-AIN11为热电偶通道,AIN12输出500ua、AIN13 AIN14为KTY81-110通道,原理图如下: 寄存器的json配置文件: { "Generic": "AD7124-8", "Registers": [ { "Address": "0x0", "Name": "Status", "Value": "0x0" }, { "Address": "0x1", "Name": "ADC_Control", "Value": "0x584" }, { "Address": "0x2", "Name": "Data", "Value": "0x0" }, { "Address": "0x3", "Name": "IO_Control_1", "Value": "0x840C" }, { "Address": "0x4", "Name": "IO_Control_2", "Value": "0x555" }, { "Address": "0x5", "Name": "ID", "Value": "0x0" }, { "Address": "0x6", "Name": "Error", "Value": "0x0" }, { "Address": "0x7", "Name": "Error_En", "Value": "0x44" }, { "Address": "0x8", "Name": "MCLK_Count", "Value": "0x0" }, { "Address": "0x9", "Name": "Channel_0", "Value": "0x8001" }, { "Address": "0xA", "Name": "Channel_1", "Value": "0x8043" }, { "Address": "0xB", "Name": "Channel_2", "Value": "0x8085" }, { "Address": "0xC", "Name": "Channel_3", "Value": "0x80C7" }, { "Address": "0xD", "Name": "Channel_4", "Value": "0x8109" }, { "Address": "0xE", "Name": "Channel_5", "Value": "0x814B" }, { "Address": "0xF", "Name": "Channel_6", "Value": "0x1" }, { "Address": "0x10", "Name": "Channel_7", "Value": "0x1" }, { "Address": "0x11", "Name": "Channel_8", "Value": "0x1" }, { "Address": "0x12", "Name": "Channel_9", "Value": "0x1" }, { "Address": "0x13", "Name": "Channel_10", "Value": "0x1" }, { "Address": "0x14", "Name": "Channel_11", "Value": "0x1" }, { "Address": "0x15", "Name": "Channel_12", "Value": "0x1" }, { "Address": "0x16", "Name": "Channel_13", "Value": "0x91AE" }, { "Address": "0x17", "Name": "Channel_14", "Value": "0x1" }, { "Address": "0x18", "Name": "Channel_15", "Value": "0x1" }, { "Address": "0x19", "Name": "Config_0", "Value": "0x9F7" }, { "Address": "0x1A", "Name": "Config_1", "Value": "0x9E0" }, { "Address": "0x1B", "Name": "Config_2", "Value": "0x860" }, { "Address": "0x1C", "Name": "Config_3", "Value": "0x860" }, { "Address": "0x1D", "Name": "Config_4", "Value": "0x860" }, { "Address": "0x1E", "Name": "Config_5", "Value": "0x860" }, { "Address": "0x1F", "Name": "Config_6", "Value": "0x860" }, { "Address": "0x20", "Name": "Config_7", "Value": "0x860" }, { "Address": "0x21", "Name": "Filter_0", "Value": "0x60180" }, { "Address": "0x22", "Name": "Filter_1", "Value": "0x60180" }, { "Address": "0x23", "Name": "Filter_2", "Value": "0x60180" }, { "Address": "0x24", "Name": "Filter_3", "Value": "0x60180" }, { "Address": "0x25", "Name": "Filter_4", "Value": "0x60180" }, { "Address": "0x26", "Name": "Filter_5", "Value": "0x60180" }, { "Address": "0x27", "Name": "Filter_6", "Value": "0x60180" }, { "Address": "0x28", "Name": "Filter_7", "Value": "0x60180" }, { "Address": "0x29", "Name": "Offset_0", "Value": "0x800000" }, { "Address": "0x2A", "Name": "Offset_1", "Value": "0x800000" }, { "Address": "0x2B", "Name": "Offset_2", "Value": "0x800000" }, { "Address": "0x2C", "Name": "Offset_3", "Value": "0x800000" }, { "Address": "0x2D", "Name": "Offset_4", "Value": "0x800000" }, { "Address": "0x2E", "Name": "Offset_5", "Value": "0x800000" }, { "Address": "0x2F", "Name": "Offset_6", "Value": "0x800000" }, { "Address": "0x30", "Name": "Offset_7", "Value": "0x800000" }, { "Address": "0x31", "Name": "Gain_0", "Value": "0x500000" }, { "Address": "0x32", "Name": "Gain_1", "Value": "0x500000" }, { "Address": "0x33", "Name": "Gain_2", "Value": "0x500000" }, { "Address": "0x34", "Name": "Gain_3", "Value": "0x500000" }, { "Address": "0x35", "Name": "Gain_4", "Value": "0x500000" }, { "Address": "0x36", "Name": "Gain_5", "Value": "0x500000" }, { "Address": "0x37", "Name": "Gain_6", "Value": "0x500000" }, { "Address": "0x38", "Name": "Gain_7", "Value": "0x500000" } ] } 读取结果如下: |
|
相关推荐
24个回答
|
|
在线等啊~~~
|
|
|
|
读取的ID为什么是0x14,
|
|
|
|
我也在做AD7124项目
|
|
|
|
|
|
|
|
|
|
|
|
ADC采集的电压值对不对?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
刚刚测了,RTD通道的电压读取正常,和实际万用表量的的基本一致; 但是K型热电偶通道,用万用表量出来都是0mv,没有电压 ,但是ad读取的值一直在变化,会慢慢的飘上去比如从0.195V(AD值 8409653)一直飘到0.331V(AD值 8424228),甚至更高。不知道是不是配置问题? |
|
|
|
jia1993win 发表于 2019-1-21 20:55 你已经开启了 V_bias,共模电压是否正常? |
|
|
|
|
|
|
|
0.195V(AD值 8409653)一直飘到0.331V(AD值 8424228)? 怎么计算出来的 |
|
|
|
fVolVal = 2500.0*(s32AdCode[u8Ch] - 0x800000)/(32.0*0x800000); fK_TempValH = (int32_t)fVolVal; fK_TempValL = (fVolVal - fK_TempValH) * 1000; Debug_Printf("rn CH%d Thermocouple Temperature: %ld.%lu V ",u8Ch,fK_TempValH ,fK_TempValL ); 代码是直接在这个的基础上修改的:完整方案分享——如何利用精密ADC AD7124-8进行热电偶采集 |
|
|
|
jia1993win 发表于 2019-1-21 21:34 s32AdCode[u8Ch] 是当前通道的AD值。 u8Ch = AD7124_STATUS_REG_CH_ACTIVE(ad7124_regs[AD7124_Status].value); ret = AD7124_ReadData(&g_ad7124dev, &s32AdCode[u8Ch]); |
|
|
|
jia1993win 发表于 2019-1-21 21:34 fVolVal = 2500.0*(s32AdCode[u8Ch] - 0x800000)/(32.0*0x800000); 单位是mV吧? |
|
|
|
这个公式里的32是怎么来的?为啥要0x800000*32.0 |
|
|
|
|
|
|
|
1. 如果你的计算公式正确,用万用表测到了0mV,按你公式计算结果是0.331mV,这个不矛盾。 2. 我不清除32是从哪里来的,我猜是PGA增益,但是你的PGA设置成了128倍。 |
|
|
|
只有小组成员才能发言,加入小组>>
994 浏览 2 评论
给ADUM4223 增加信号驱动15V电压就不正常, 波动很大会被烧是什么情况?
1388 浏览 2 评论
ADP5092 SYS端口为2.09V,但是REG_OUT为0是什么原因?
1940 浏览 1 评论
ad7193差分输入ain1与ain2差是正值时,读到电压与实际值误差小,但为负值值,误差就变的很大
4272 浏览 2 评论
9063 浏览 1 评论
ADC3442采集,分析数据出现有规则毛刺,请问是哪方面的问题啊?
1529浏览 3评论
AD7190状态寄存器一直是0x80,连续转换模式下RDY不拉低
1695浏览 2评论
995浏览 2评论
1671浏览 2评论
给ADUM4223 增加信号驱动15V电压就不正常, 波动很大会被烧是什么情况?
1388浏览 2评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 08:56 , Processed in 1.183010 second(s), Total 81, Slave 75 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号