完善资料让更多小伙伴认识你,还能领取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板卡-CAN编程示例之开发板测试
654 浏览 0 评论
该问题是用APP给芯海科技的CST92F25芯片发指令是出现的
2242 浏览 1 评论
771 浏览 0 评论
1530 浏览 1 评论
2276 浏览 1 评论
浏览过的版块 |
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 03:16 , Processed in 0.707881 second(s), Total 71, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号