完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
HiLIM使用MPLABX V3.61和V2.03B和和声配置器V2.0.3.5。使用PIC32以太网启动器套件2开发,IM试图使用其中一个交换机触发一些事件,并在和谐上使用更改通知功能发送消息。我注意到,这仅触发了一次,我按下并释放了按钮,因此大概是TH的状态。E I/O引脚有两次改变吗?1 & 0;1,有没有办法在每次改变时触发?1和0和0和1;谢谢,杰姆斯
以上来自于百度翻译 以下为原文 Hi all Im using MPLABX v3.61 with HARMony v2.03b and harmony configurator v2.0.3.5. developing using the PIC32 ethernet starter kit 2, im trying to use one of the switches to trigger some events and send a message using the change notification feature on harmony. What i have noticed is that this only triggers once i have pressed and released the button so presumably the state of the i/o pin changes twice there? 1>0>1 is there a way to have it trigger on every change? 1>0 and 0>1? Thanks, James |
|
相关推荐
8个回答
|
|
更新:我在中断例程中设置断点,这样当我在调试期间按下触发触发更改通知的开关时,断点就会断开。我注意到:-我按下(但不释放)开关-断点命中(仍然按住开关按下)-点击CONTIONE -断点再次命中(仍然没有从第一次按下开关释放)断点继续打直到我释放开关,似乎只要我持有开关中断不断发生。这不是我想要实现的,我需要中断发生一次WH。当我释放开关时,我按下开关,再一次。在协调器、init例程或中断发生时,有什么东西我没有正确设置吗?谢谢,杰姆斯
以上来自于百度翻译 以下为原文 Update: I set a breakpoint within the interrupt routine so that when i press the switch that triggers the change notification during debugging the breakpoint will break. What ive noticed is that: - i press (but do not release) the switch - the breakpoint hits (still holding the switch pressed) - click continue - the breakpoint hits again (still not released from the first press of the switch) the breakpoint continues to hit until i release the switch, it seems that for as long as i hold the switch the interrupt keeps occuring. this is not what i want to achieve, I need the interrupt to occur once when i press the switch and once again when i release the switch. Is there something i am not setting correctly either in harmony configurator, init routines, or as the interrupt occurs? Thanks, James |
|
|
|
嗨,你能显示一下中断代码吗?(请代码标签)您是否在退出之前检查中断是否已清除?请确认我们的CPU是一个PIC32 MX795F512L对您的初学者KITAY
以上来自于百度翻译 以下为原文 Hi, Can you show the interrupt code ? (please code tags) Did you check if the interrupt is cleared before exiting ? Please confirm to us that the CPU is a PIC32MX795F512L on your starter kit Regards |
|
|
|
我的快速反应是:确保在获得CN后读取PIN,这样就可以重新设置CN,这样您就可以得到更多。
以上来自于百度翻译 以下为原文 My quick response is: be sure that you read the pin after getting a CN - this resets the CN so you can get more. There is an example/demo for CN here in the harmony file system tree: appsexamplesperipheralportscn_interrupt /* void APP_SwitchChangeNoticed ( void ) Summary: Called back by the Change Notice (CN) interrupt. Clears CN condition and flag and sets internal flag to identify the . Remarks: context and tickCount parameters ignored. */ void APP_SwitchChangeNoticed ( void ) { uint32_t __attribute__ ((unused)) temp; /* Read port to clear mismatch on change notice pins */ temp = PLIB_PORTS_Read(PORTS_ID_0, APP_CN_PORT_CHANNEL); /* Clear the interrupt flag */ SYS_INT_SourceStatusClear(APP_CN_PORT_INTERRUPT); /* Set flag indicating that a changed has been noticed. */ appData.changeNoticed = true; } |
|
|
|
是的,CPU是PIC32 MX795F512L,这里是源代码:CN被设置为CN16上的触发器(RD7,PIN 84)
以上来自于百度翻译 以下为原文 Yes the CPU is a PIC32MX795F512L, here is the source code: // interrupt service routine void __ISR(_CHANGE_NOTICE_VECTOR, ipl1AUTO) _IntHandlerChangeNotification(void) { APP_Set_Trigger(); //application function added by me PLIB_INT_SourceFlagClear(INT_ID_0, INT_SOURCE_CHANGE_NOTICE); //harmony generated line } //application function void APP_Set_Trigger ( void ) { mAppData.trigger = true; //sets a flag to true to be acted on in state machine return; } The CN is set to trigger on CN16 (RD7, pin 84) |
|
|
|
您好,请仔细阅读上面的MadiaDaWGPOST并与您的代码进行比较。读取端口是非常重要的,否则中断原因不会得到明确的理解。
以上来自于百度翻译 以下为原文 Hi, Please read carefully MicroDawg post above and compare with your code. It is vital to read the port otherwise the interrupt cause will not get cleared Regards |
|
|
|
这是否需要使用PLIbxPosisRad()函数来完成?如果是这样,参数需要什么?
以上来自于百度翻译 以下为原文 Does this have to be done using the PLIB_PORTS_Read() function? if so what will the parameters need to be? |
|
|
|
再次,请仔细阅读这篇文章:HTTP://www. MicroChIP.FoMss/FordPas/1008950,解释了所有的内容,并给出了代码。
以上来自于百度翻译 以下为原文 Hi, Again, please read carefully this post :http://www.microchip.com/forums/FindPost/1008950 everything is explained and the code is shown. As it is mentioned you can also refer to Harmony CN example : c:microchipharmonyv2_03bappsexamplesperipheralportscn_interrupt Regards |
|
|
|
谢谢你的建议和帮助,我现在开始工作了。我在我的空隙AppSuthSub触发器(空)函数中使用PLIbxPosisLad()读取端口。
以上来自于百度翻译 以下为原文 Thanks for your advice and help, i now have it working. I read the port using PLIB_PORTS_Read() within my void APP_Set_Trigger ( void ) function. |
|
|
|
只有小组成员才能发言,加入小组>>
5160 浏览 9 评论
1998 浏览 8 评论
1927 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3170 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2225 浏览 5 评论
729浏览 1评论
613浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
503浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
628浏览 0评论
526浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 14:30 , Processed in 1.484764 second(s), Total 93, Slave 76 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号