完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
HI论坛,为了在2毫秒的时间内尽可能快地测量3个模拟电压,我为3个通道建立了和谐2.03b。我选择中断模式,中断源[ItnStuxEyAdCy1]中断向量[ItnVector,ADC1]中断优先级[ItnPrimeRealIrrime3]中断子优先级[ITNSUPPRPR ]。iOrthyIoLe0.0]我设置的每个通道使用触发器源[ADCHSUTGRIGGEL SURCESTYTMR3GHOR],但是对于ADC产生的ISR,Valuy-Y-ISR(O-AdCyValm,IPL3Auto)ythANDLRDVADC(空隙)没有被调用过。当然,我也设置了定时器3(也使用和声)。为了测试目的,我让ISR切换一个引脚,并用示波器检查。我得到了一个切换每500纳秒,给予或采取一点抖动,正如预期的那样。然后我改变了time3 ISR不会被调用。但是,Time3仍然应该触发3个ADC通道。ADC ISR永远不会运行。所以我试着投票。但是调用信道0…2的DVVYADCX采样可用(ChhannEngEnter)总是返回false。应该如何设置ADC,这样定时器将触发它,并且测量结果可用吗?
以上来自于百度翻译 以下为原文 Hi forum, in order to measure 3 analog voltages as fast as possible over a duration of 2 ms, I set up HARMony 2.03b for 3 channels. I chose Interrupt Mode with Interrupt Source [INT_SOURCE_ADC_1] Interrupt vector [INT_VECTOR_ADC1] Interrupt Priority [INT_PRIORITY_LEVEL3] Interrupt Sub-priority [INT_SUBPRIORITY_LEVEL0] Each channel I set up to use Trigger source [ADCHS_TRIGGER_SOURCE_TMR3_MATCH] But the generated ISR for ADC, void __ISR(_ADC_VECTOR, ipl3AUTO) _IntHandlerDrvAdc(void) doesn't get called ever. Of course I also set up timer 3 (also using Harmony). For testing purposes I let the ISR toggle a pin and checked with an oscilloscope. I got a toggle every 500 ns, give or take a little jitter, just as expected. I then changedstatic void _DRV_TMR1_Resume(bool resume) { if (resume) { PLIB_INT_SourceFlagClear(INT_ID_0, INT_SOURCE_TIMER_3); #warning Investigate if PLIB_INT_SourceEnable() call should be suppressed for ADC timer source. //PLIB_INT_SourceEnable(INT_ID_0, INT_SOURCE_TIMER_3); PLIB_INT_SourceDisable(INT_ID_0, INT_SOURCE_TIMER_3); PLIB_TMR_Start(TMR_ID_3); } }So the Timer3 ISR won't get called. But, Timer3 should still trigger 3 ADC channels. The ADC ISR does never run. So I tried to poll. But calling DRV_ADC_SamplesAvailable(channelIndex) for channels 0..2 always returns false. How is ADC supposed to be set up so timer will trigger it and measurement results are available? |
|
相关推荐
1个回答
|
|
事实证明,一个人必须把个人ADC模块转换成个人代码,这是在和声初始化之后解决的。
以上来自于百度翻译 以下为原文 As it turns out, one has to turn the individual ADC modules on individuallyADCCON1bits.ON = 0; ADCCON3bits.DIGEN1 = 1; ADCCON3bits.DIGEN2 = 1; ADCCON3bits.DIGEN3 = 1; ADCCON1bits.ON = 1;In code that is called after Harmony's initialization solves my problem. |
|
|
|
只有小组成员才能发言,加入小组>>
5189 浏览 9 评论
2009 浏览 8 评论
1933 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3181 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2232 浏览 5 评论
746浏览 1评论
632浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
517浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
644浏览 0评论
544浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-1 00:17 , Processed in 1.202778 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号