完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,我是MPlab的新手,我正在尝试模拟我写的代码。基本上,PIC的代码是它有2个UART。数据可以通过UART接收,并传递给另一个UART来传输。我用和声来生成代码。我的问题是如何模拟数据进入UART,这样我就可以观看/通过程序来查看它是否工作。这是一个使用中断的基本程序。我设计了一个更完整的集线器,有5个UART,所以希望能先理解这个过程。一步一步的指导将是有益的。
以上来自于百度翻译 以下为原文 hi i am new to MPlab and i am trying to simulate the code i have written. Basically the code for a pic is it has 2 uarts. Data can be receive by either uart and pass to the other uart to be transmitted. I am using hARMony to generate the code. The problem i have is how do i simulate data coming into a uart so i can watch/step through the program to see if it works. this is a basic program using interrupts. I am designing a more complete hub with 5 uarts so would like to be able to understand the process first. a step by step guide would be helpfull. i have enable the simulation regards Ross |
|
相关推荐
2个回答
|
|
转到MPLAB X帮助,MPLAB X模拟器-GT;使用刺激& GT;刺激窗口-GT;注册表注入选项卡部分。刺激被用来模拟从外部源进入模拟PIC设备的值。刺激是简单、快速、肮脏的方法。有更先进的技术,但从刺激开始。
以上来自于百度翻译 以下为原文 Go to the MPLAB X help, MPLAB X Simulator -> Using Stimulus -> Stimulus Window -> Register Injection Tab section. Stimulus is used to model values coming into the simulated PIC device from an external source. Stimulus is the simple, quick and dirty, methodology. There are more advanced techniques, but start with stimulus. |
|
|
|
我也试过了。事实上就是现在!首先,必须启用UART。这个帮助至少告诉了你很多。然后你可以使用刺激窗口并添加一行。我用的是F1829,所以我想把它推向RCREG。触发器是“消息”、“包装”=“否”、“格式=十六进制”,而我的数据文件名是这样的:等待2秒63等待200秒69,即0x63(或“c”)和0x69(或“h”)。在我点击“应用同步刺激”按钮之前,运行调试似乎没有任何作用。然后它似乎开始了…要么我在文件中犯了错误(没有警告-文件被忽略),或者“等待0秒”一开始,这可能意味着在串行端口被完全初始化之前应用了刺激。也许……而且,刺激对话必须开放,让刺激变得活跃。希望这能有所帮助,Conor。
以上来自于百度翻译 以下为原文 I've tried this as well. Just now in fact! First you have to enable the UART. The help tells you that much at least. Then you can use the Stimulus window and add a row. I'm using an 'F1829 so I wanted to push into RCREG. The trigger was "message", wrap =no, format=hex and my data filename looked this this: wait 2 sec 63 wait 200 sec 69 That's 0x63 (or 'c') and 0x69 (or 'h'). Running the debug didn't seem to do anything until I clicked the "apply synchronous stimulus" button. Then it seemed to kick off... Either that or I made a mistake in the file (there are no warnings - the file is just ignored) or had "wait 0 sec" initially which probably mean the stimulus was applied before the serial port was fully initialised. Maybe... Also, the Stimulus dialog must be open for stimulus to be active. Hope this helps, Conor. |
|
|
|
只有小组成员才能发言,加入小组>>
5250 浏览 9 评论
2037 浏览 8 评论
1958 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3218 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2266 浏览 5 评论
788浏览 1评论
680浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
609浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
685浏览 0评论
582浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-29 03:14 , Processed in 1.247887 second(s), Total 77, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号