完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
你好,在我的Microchip C代码中,我有一个计算,它的结果不完全像我预期的那样,里面有一些问题。我是一个西门子PLC程序员,在西门子中有一个功能,你可以在执行它的时候上网和监控代码。所以你可以看到的问题是,还有一种可能性,我可以监控我的Microchip C代码。如果可能的话,例如从微秒到微秒库尔特
以上来自于百度翻译 以下为原文 hello, in my microchip c code i have a calculation and the outcome of it is not exactly as i expect, there are some issues in it. i am more a siemens plc programmer and in siemens there is a function that you can go online and monitor the code while it is executed. so that you can see were the problem is. is there also a possibility that i can monitor my microchip c code. and if possible for instance from microsecond to microsecond gr kurt |
|
相关推荐
8个回答
|
|
|
|
|
|
我想知道你打算用哪种特殊的照片?
以上来自于百度翻译 以下为原文 I wonder which particular PIC you are intending to use ? |
|
|
|
你的帖子里有问题吗?你的代码不能像你想象的那样工作。您没有添加任何代码,没有PIC,没有编程语言,并发布了IDE。你能看到从微秒到微秒的数据吗?你有很多选择。从使用模拟器或调试器开始单步执行。
以上来自于百度翻译 以下为原文 Is there a question in your post? Your code does not work the way you would think it would. You added no code, no pic, no programming language , and posted about the ide. Can you see data from micro second to micro second? You have a lot of options. Starting with using a simulator or a debugger to single step. |
|
|
|
你好,我用的是PIC18F2220。这个模拟器我在Google上搜索并在YouTube上找到了一些东西。
以上来自于百度翻译 以下为原文 hey hello, i use a pic18f2220. this simulator i googled it and found something on youtube. i'am going to try something with it |
|
|
|
库尔特,你愿意分享计算的代码吗?
以上来自于百度翻译 以下为原文 kurt, Would you care to share the code for the calculation ? |
|
|
|
当然,整个代码或只是我正在挣扎的一块。
以上来自于百度翻译 以下为原文 yes of course, the entire code or just the piece i'am struggling with |
|
|
|
我们可以从你正在挣扎的那一部分开始。
以上来自于百度翻译 以下为原文 We could start with the piece you are struggling with. |
|
|
|
首先,我需要解释一些很长一段时间,我想做一个转速表(在这个论坛的帮助)上的球迷在后面的网站,我把红外LED,并在前面的网站IR接收,每当一个叶片的风扇通过。IR光到IR接收器被中断,这导致PUR。这一部分在硬件站点上运行良好。我有一个设备来检查这个代码。代码是用它计算两个脉冲之间的时间来构造的,这样我就用它来计算RPM。除了捕获部分之外,代码中的每一项都有效。随着时间的推移,我得到了许多变种来捕捉两个脉冲之间的时间,但下面的一个工作最好。但是在TMR1IF使用时,我怎么说:“如果我打开风扇,显示的值不会下降,”看看它////////////////////////////////If(PrI1BIT.Cp1IF和Ap&步骤=0和&;Prim1It。TMR1IF=0){Coprd1=CCPR1;////PHIL1BIT.CCP1IF=0;STEP=2;否则,如果(Prim1But.TMR1IF=1){ TimePosith=时间溢出+ 1;PrI1BIT.TMR1IF=0;}否则(PrI1BIT.CCP1IF和AMP;STATE=1){Coprd2=时间溢出*65536;步骤=3;时间溢出=0;}否则(步骤=2){CAPYVAL=CAPETUR1;STEP=0;RealeTimeR1(0x000);} EL;Se IF(步骤=3){CAPYVAL=CAPETIL1+CAPETUR2;STEP=0;WrreTimeRe1(0x000);} Rev=60000000/CAPVAL;
以上来自于百度翻译 以下为原文 first i need to explain something for a long time i am trying to make a tachometer (with help from this forum) on a fan on the back site i put a ir led and on the front site a ir reciever, , every time a blade of the fan passes. the ir light to the ir receiver is interrupted which results in a puls. this part on the hardware site works good i have a device to check this the code is constructed in a way that it counts the time between two pulses and in this way i use it to calculate the rpm. everything in my code works except the capture part. with time passing on i got many variants to capture the time between two pulses but the one underneath works the best. but still at low rpm when the tmr1if is used how do i say it: 'if i turn of the fan the displayed value doesn't drop fluently' look at it /////////////////////////////////// if (PIR1bits.CCP1IF && step ==0 && PIR1bits.TMR1IF==0) { capture1 = CCPR1 ; ///// PIR1bits.CCP1IF = 0; step=2; } else if (PIR1bits.TMR1IF==1 ) { step = 1; timeoverflow = timeoverflow + 1; PIR1bits.TMR1IF = 0; } else if ( PIR1bits.CCP1IF && step ==1) { capture2 = timeoverflow * 65536 ; step = 3; timeoverflow = 0; } else if (step ==2) {cap_val = capture1; step = 0; WriteTimer1( 0x0000 ); } else if (step ==3) {cap_val = capture1 + capture2; step = 0; WriteTimer1( 0x0000 );} } rev= 60000000 / cap_val; |
|
|
|
只有小组成员才能发言,加入小组>>
5183 浏览 9 评论
2005 浏览 8 评论
1932 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3178 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2229 浏览 5 评论
739浏览 1评论
626浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
510浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
637浏览 0评论
535浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 21:13 , Processed in 1.237337 second(s), Total 89, Slave 73 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号