完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
用AD7792测四线制铂电阻,但是测出来的值一直为0,有没有哪位大佬帮忙看看哪里有问题,谢谢
Resettime=32; CLK_H; CS_L; MOSI_H; while(ResetTime--) //超过连续32个周期为高电平即复位 { CLK_L; delay_us(200); CLK_H; delay_us(200); } delay_us(500); AD7792WriteByte(WriteConfReg); //configuration register AD7792WriteByte(0x12);//单极性,增益Gain 4 AD7792WriteByte(0x90);//internal Reference,带缓冲 while(1) { AD7792WriteByte(WriteIOReg);//IO register AD7792WriteByte(0x03); AD7792WriteByte(WriteModeReg);//Mode Register AD7792WriteByte(0x20);//单次转换 AD7792WriteByte(0x0A);//inter 64 kHZ clock.internal clock is not available at the clk pin. AD7792WriteByte(ReadStateReg);//write to Communication register.The next step is to read from Status register. status = AD7792Read(8); while((status&0x80) == 0x80) //wait for the end of convertion by polling the status register RDY bit { AD7792WriteByte(ReadStateReg);//write to Communication register.The next step is to read from Status register. status = AD7792Read(8); UARTprintf("status:%xn", status); } AD7792WriteByte(ReadDataReg); //write to Communication register.The next step is to read from Data register. AD7792_Data = AD7792Read(16); UARTprintf("V:%dn", AD7792_Data); |
|
相关推荐
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
飞凌嵌入式ElfBoard ELF 1板卡-烧录流程介绍之单独更新内核
856 浏览 1 评论
飞凌嵌入式ElfBoard ELF 1板卡-TF卡烧录流程之烧写过程
836 浏览 0 评论
iTOP-3A5000主控板龙芯架构外加机箱就是一台电脑主机
1251 浏览 0 评论
迅为RK3568开发板EMMC镜像导出打包update.img
1542 浏览 0 评论
飞凌嵌入式-ELFBOARD 硬件知识分享-ELF 2电源电路讲解
1752 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-4 06:56 , Processed in 0.451979 second(s), Total 39, Slave 33 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号