完善资料让更多小伙伴认识你,还能领取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-文件I/O的深入学习之阻塞I/O与非阻塞I/O
307 浏览 0 评论
大神们,想知道你们都用什么ide编程调试器? Arduino IDE?还是 e2studio ?还有其他吗?哪个好用呢
459 浏览 0 评论
825 浏览 0 评论
790 浏览 0 评论
飞凌嵌入式ElfBoard-文件I/O的了解探究之复制文件描述符
717 浏览 0 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 19:16 , Processed in 0.728166 second(s), Total 71, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
728