1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我按照官网的程序来写,在main函数里初始化。
之后,在while(1)循环里调用dout = ADC_Read(CH1),发现,无论我是读CH1还是其它AD通道,始终只输出CH0通道的AD值,请问我这问题出在哪? u16 ADC_Read(u16 ch) { u16 ReturnData = 0x0000; switch(ch) { case CH0: ReturnData = WriteToSequenceRegister (VIN0); ReturnData = WriteToControlRegister(CH0, Mode0, Normal, StraightBinary, Ref_En, SequencerOff); ReturnData = ReadSequence(); break; case CH1: ReturnData = WriteToSequenceRegister (VIN1); delay_us(1000); ReturnData = WriteToControlRegister(CH1, Mode0, Normal, StraightBinary, Ref_En, SequencerOff); delay_us(1000); ReturnData = ReadSequence(); delay_us(10); break; case CH2: ReturnData = WriteToSequenceRegister (VIN2); ReturnData = WriteToControlRegister(CH2, Mode0, Normal, StraightBinary, Ref_En, SequencerOff); break; case CH3: ReturnData = WriteToSequenceRegister (VIN3); ReturnData = WriteToControlRegister(CH3, Mode0, Normal, StraightBinary, Ref_En, SequencerOff); break; case CH4: ReturnData = WriteToSequenceRegister (VIN4); ReturnData = WriteToControlRegister(CH4, Mode0, Normal, StraightBinary, Ref_En, SequencerOff); break; case CH5: ReturnData = WriteToSequenceRegister (VIN5); ReturnData = WriteToControlRegister(CH5, Mode0, Normal, StraightBinary, Ref_En, SequencerOff); break; case CH6: ReturnData = WriteToSequenceRegister (VIN6); ReturnData = WriteToControlRegister(CH6, Mode0, Normal, StraightBinary, Ref_En, SequencerOff); break; case CH7: ReturnData = WriteToSequenceRegister (VIN7); ReturnData = WriteToControlRegister(CH7, Mode0, Normal, StraightBinary, Ref_En, SequencerOff); break; default: break; } return ReturnData; } |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
992 浏览 2 评论
给ADUM4223 增加信号驱动15V电压就不正常, 波动很大会被烧是什么情况?
1387 浏览 2 评论
ADP5092 SYS端口为2.09V,但是REG_OUT为0是什么原因?
1940 浏览 1 评论
ad7193差分输入ain1与ain2差是正值时,读到电压与实际值误差小,但为负值值,误差就变的很大
4271 浏览 2 评论
9063 浏览 1 评论
ADC3442采集,分析数据出现有规则毛刺,请问是哪方面的问题啊?
1524浏览 3评论
AD7190状态寄存器一直是0x80,连续转换模式下RDY不拉低
1694浏览 2评论
992浏览 2评论
1669浏览 2评论
给ADUM4223 增加信号驱动15V电压就不正常, 波动很大会被烧是什么情况?
1387浏览 2评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 12:48 , Processed in 0.683933 second(s), Total 73, Slave 57 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号