完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,在这个时刻我是个死胡同。我确信我做错了什么,但我不知道是什么。所以我需要你的帮助。这是我的问题:我有一个应用程序需要使用六个模拟输入(AN2,AN3,AN4,AN47,AN48和AN49)的PIC32 MZ2048 EFG100。我使用Microchip和谐配置器来设置ADC(在这个例子中只使用了两个ADC实例)。该设置显示在MHCCapture.JPG。代码示例在App.C.当我运行这个代码时,它停止在第二个while循环(第124行),表示没有任何数据可用于AN48。因为它通过了第一个while循环(第116行),所以我假设AN47有可用的数据。因此,ADC2的设置和工作正常。当我将MHC中的第一个It设置为ADC3,而第二个实例为ADC2时,程序将停止在属于AN47的while循环中。似乎MHC的ADC部分中的第二个实例不知怎么地没有被正确配置。我通过了生成的代码,但不知道问题是什么。任何帮助都是受欢迎的。在zip文件中,完整的项目。BTW。我使用MPLABS XIDE V3.30和1.09(尝试MPLAX XIDE 3.55和和声2.02.00 B,结果相同)。
AccelerationSensors.zip(445.75 KB)-下载121次 以上来自于百度翻译 以下为原文 Hi, At this moment I am at a dead end. I am sure I am doing something wrong, but I can't figure out what it is. So I need you help. Here is my problem: I have an application that needs to use six analog inputs (AN2, AN3, AN4, AN47, AN48 and AN49) of the PIC32MZ2048EFG100. I used the Microchip HARMony Configurator to set up the ADCs (only two ADC instances are used in this example). The setup is shown in MHCCapture.JPG. The code example is in APP.c When I run this code the it stops at the second while loop (line #124) indicating that there is never any data available for AN48. Since it got past the first while loop (line #116) I assume that there was data available for AN47. Thus the ADC2 was setup and working correctly. When I setup the first intance in the MHC to be ADC3 and the second instance to be ADC2 the program will stop at the while loop belonging to AN47. It seems that the second instance in the ADC section of the MHC is somehow not configured correctly. I went through the generated code but can't figure out what the problem is. Any help is welcome. In the zip file the complete project. BTW. I am using MPLABS X-IDE v3.30 with Harmony 1.09 (have tried MPLAB X-IDE 3.55 and harmony 2.02.00b with the same result). Attached Image(s) Attachment(s) app.c (6.47 KB) - downloaded 65 times AccelerationSensors.zip (445.75 KB) - downloaded 121 times |
|
相关推荐
2个回答
|
|
看起来你已经打开了ADC0而不是ADC1。在协调代码生成之后,你有没有麻烦让它编译?我基本上是在尝试和你做同样的事情(完全相同的和谐配置)。但是当我有了和谐生成代码之后,当我尝试构建这个项目时,我会遇到很多错误。你经历过这样的事情吗?
以上来自于百度翻译 以下为原文 It looks like you have opened ADC0 but not ADC1. Did you have any troubles getting it to compile after harmony code generation? I am basically trying to do the same thing as you (exact same harmony config). But after I have harmony generate the code, I get a bunch of errors when I try to build the project. Did you experience anything like this? |
|
|
|
嗨,Iveng,是的,你对ADC1X打开函数是正确的。问题是,我也预期AdxxSoad会出现在API中,但似乎没有。这使我感到困惑,不知怎的,我再也没有想到过ADC1ON。我仍然觉得奇怪的是,你必须“打开”每个驱动程序的安装,但是只有一个“全局”启动函数。所以非常感谢。但是我并没有得到你似乎有的错误。你能上传输出(或项目),所以我们都可以看看吗?
以上来自于百度翻译 以下为原文 Hi Iveng, Yes you are right about the ADC1_open function. The problem was that I also expected an ADCx_Start to be in the API but there seems not be any. This confused me and somehow I never thought of ADC1_Open again. I still find it strange that you explicitly have to 'open' every driver instace but that there is only one 'global' start function. It now seems to work fine. So thanks very much. However I do not get the bunch of errors that you seem to have. Can you upload the output (or the project) so we all can have a look at it? |
|
|
|
只有小组成员才能发言,加入小组>>
5162 浏览 9 评论
2000 浏览 8 评论
1928 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3172 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2226 浏览 5 评论
731浏览 1评论
613浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
503浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
629浏览 0评论
527浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 04:28 , Processed in 1.150859 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号