完善资料让更多小伙伴认识你,还能领取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); |
|
相关推荐
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
787 浏览 0 评论
飞凌嵌入式ElfBoard ELF 1板卡-mfgtools烧录流程介绍之烧写所需镜像
888 浏览 0 评论
飞凌嵌入式ElfBoard ELF 1板卡-mfgtools烧录流程之烧写方法
608 浏览 0 评论
飞凌嵌入式ElfBoard ELF 1板卡-内核编译之初次编译
905 浏览 0 评论
飞凌嵌入式ElfBoard ELF 1板卡-内核源代码的目录结构和文件说明
821 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 13:34 , Processed in 0.569635 second(s), Total 70, Slave 53 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号