完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
嗨,我忙着用DSPICFJ128GP802,I,M查看编译器内存视图,看看代码需要多少指令。什么指令需要更多的1个周期?提前感谢
以上来自于百度翻译 以下为原文 Hi, i,m busy with DSPICFJ128GP802, i,m looking in the compiler memory view to see how many instructions a code takes. What are instructions that take more then 1 cycle ? thanks in advance |
|
相关推荐
19个回答
|
|
|
应该在数据表-我似乎记得大多数RAM访问指令,特别是如果涉及EDS…
以上来自于百度翻译 以下为原文 Should be in the datasheet - I seem to remember most RAM accessing instructions, especially if EDS is involved... |
|
|
|
|
|
|
|
|
|
|
|
大多数是1个周期。跳跃、呼叫、返回等是2个周期。TBRRDL和/或PSV接入需要额外的周期。这都是有据可查的。
以上来自于百度翻译 以下为原文 Most are 1 cycle. Jumps, calls, returns etc. are 2 cycle. TBLRDL and/or PSV access takes extra cycles. It is all well documented. |
|
|
|
|
|
好的,我在指令集概览中找到了,只有一些人说:CysEs1(2)OR1(2或3)的哪一个是哪个?
以上来自于百度翻译 以下为原文 Ok i found it in instruction set overview, only some say : # of cycles 1 ( 2 ) or 1 ( 2 or 3 ) Which one is it ? |
|
|
|
|
|
|
|
|
|
|
|
这是一个分支。循环:1(2个IF分支)-PIC24F、PIC24H、DSPIC30F、DSPIC33 F1(4 IF分支)-PIC24E、DSSPICE E和LT;F芯片& Gt;fCy=40MHZToT=35 CysSeTimes=875毫秒。
以上来自于百度翻译 以下为原文 That is a branch. Cycles: 1 (2 if branch taken) – PIC24F, PIC24H, dsPIC30F, dsPIC33F 1 (4 if branch taken) – PIC24E, dsPIC33E mov #10,w0 ;1 loop: dec w0,w0 ;1*10 bra nz,loop ;2*10 +1(on no branch) return ;3 total = 35 cycles time = 875 nano-seconds |
|
|
|
|
|
|
|
|
|
|
|
这些通常是测试/比较和跳过和分支指令。当不跳过/分支时,一个周期,跳过/分支时,两个或三个周期;在某些PIC设备上的操作采取额外的周期。
以上来自于百度翻译 以下为原文 Those are usually the test/compare and skip and branch instructions. One cycle when not skipped/branched, two or three cycles when skipped/branches; operations on certain PIC devices take the additional cycle. |
|
|
|
|
|
像推.d W0和2次推送一样,但是只有1个指令v2推W0Press W1
以上来自于百度翻译 以下为原文 Like push.d w0 takes the same time as 2 pushes but only 1 instruction vs 2. push w0 push w1 |
|
|
|
|
|
很好,谢谢,所以最好做if语句,以便大多数情况是if(1)而不是if(0),或者它还包括其他吗?
以上来自于百度翻译 以下为原文 Nice, thanks, so better make if statements so that most cases are if( 1 ) instead of if( 0 ), or does it include the else also ? |
|
|
|
|
|
你说的是C,它不会直接翻译成ASM。(检查DIS ASM)你是否担心一些额外的NSECs?1行C代码可以翻译成100的ASM单词。
以上来自于百度翻译 以下为原文 You are talking about C and that won't translate directly to asm. (Check the dis-asm) In any case are your worried about some extra nsecs? 1 line of C code could translate to 100's of asm words. |
|
|
|
|
|
甚至还有比芯片内的微代码更低的代码。
以上来自于百度翻译 以下为原文 There's even lower code than asm. micro-code that is inside the chip. |
|
|
|
|
|
嗨,它不是一个使用所有时间的单一指令,不管是1个周期还是2个周期的指令,它是所有的指令一起占用时间。做时间测量。使用一个单一的,自由运行的16位,或32位定时器,运行指令时钟频率,你可以有时间测量。在指令循环中,使用无符号整数算法进行定时计算,其大小与计时器寄存器的大小相同。不清零或重置计数器,在间隔开始时取值,然后在完成动作时再次执行。可以用于多个嵌套的测量。或者切换一个PIN,并使用示波器或逻辑分析仪来测量时间。智能选择算法和整洁的实现,可能比使用指令更有效。编译器在本地范围内通常是合理有效的。如果算法操作笨拙,则不会有很大帮助。迈西尔
以上来自于百度翻译 以下为原文 Hi, It isn't single instructions that use all the time, whether 1 cycle or 2 cycle instructions, it is all the instructions together that take up the time. Do time measurements. Using a single, free-running 16 bit, or 32 bit timer, running with instruction clock frequency, you may have time measurements in instruction cycles. Use unsigned integer arithmetic for timing calculations, with the same size type as the timer register. Do not Clear or reset the counter, pick up the value at interval start, and then again when action is completed. elapsed_time = end_time - start_time; That way, the same timer may be used for multiple nested measurements. Or toggle a pin, and use Oscilloscope or a Logic Analyzer to measure timing. Smart selection of algorithm, and tidy implementation, may have much more effect than fiddling with instructions. Compiler is usually reasonably efficient in a local scope, it cannot help much if the algorithm do awkward operations. Mysil |
|
|
|
|
|
谢谢,我知道,我正在寻找一种不显示的方式,我必须建立一个测试项目。PIN我也切换到看DAC中断在我的模拟范围内花了多长时间,我仍然需要购买一个数字范围,首先我要一个万用表。我还是喜欢进入这个ASM代码,我有仪器。UCIST列表打印,它没有编译和覆盖Flash更快,也没有项目附件。是的,我想要最好的,所以我需要找出改进是否更好。
以上来自于百度翻译 以下为原文 Thanks, i know, i was searching for a way without display, i have to set up a test project. The pin i toggle also for looking how long the DAC interrupt takes in my analog scope, i still need to buy a digital scope, first i go for a multimeter. Still i like to get into this ASM code, i have the instruction list printed, its faster without compiling and overwriting flash, also without project attached. Yes, i want the best, so i need to find out if improvements are better. |
|
|
|
|
|
嗨,你应该真正开始用C语言。XC16是一个非常成熟的编译器(特别是Pro模式),只有在很少的情况下,你会击败生成的代码。我的经验是,一般只有5%的代码可能需要手工优化。这是代码执行可能至关重要的地方。DSPIC有DMA真正卸载处理器。如果需要使用特定于DSPIC的指令,那么就有已经在ASM中编写的内置函数。
以上来自于百度翻译 以下为原文 Hi, You should really start with C language. XC16 is a very mature compiler (especially with PRO mode) and only in rare cases you will beat the generated code. My experience is that generally just 5 % of code may need to be hand optimized. This is where code execution is potentially critical ... dsPIC has DMA which really offload the processor. If you need to use dsPIC specific instructions, then there are builtin functions which are already written in ASM. Regards |
|
|
|
|
|
好的,我,在内置函数中,我想要所有隐藏的电源。DMA只用于外围设备。还是能使信号处理更快?对于MIDI,我不能使用DMA,因为大小可能不同,大部分是3字节,可以更多。
以上来自于百度翻译 以下为原文 Ok, i,m intrested in builtin functions, i want all the hidden power. DMA is for peripherals only ?, or can it make signal processing faster ? For MIDI i cannot use DMA because size might vary, mostly 3 bytes, can be more. |
|
|
|
|
|
HI,DMA用于将数据从外围设备传输到存储器,反之亦然,无需代码执行。它与CPU并行工作;
以上来自于百度翻译 以下为原文 Hi, DMA is for transferring data from peripheral to memory and vice-versa without code execution. It operates in parallel to the CPU ;=) Regards |
|
|
|
|
|
“DMA只用于外围设备吗?”大多数情况下,尽管可以将内存移动到其他MPU上。但是设置DMA siZe.Bu建dIn不是隐藏的电源,其中一些可能只有几个字节长。它们只是为了方便。
以上来自于百度翻译 以下为原文 "DMA is for peripherals only?" Mostly, although you can move memory to memory on other mpus. You set the DMA size. build-in is not hidden power and some of those might only be a few bytes long. They are just for convenience. Like risc said, learn C first. |
|
|
|
|
|
一些(多)万用表有一个很好的特点:一个带占空比显示的频率计。我个人有一个示波器,但它并不方便(它是基于PC的,需要不同的OS运行)。所以我最喜欢的方法是用万用表测量频率/占空比。取一个频率值,我看到总程序循环速度。以占空比为例,我看到由BSET/BCULL汇编指令标记的程序部分占用了一部分时间。
以上来自于百度翻译 以下为原文 There is a nice feature of some (many) multimeters: a frequency meter with duty cycle display. Personally I have an oscilloscope but it is not convenient (it is PC-based and requiring different OS to run). So my favorite method is frequency/duty cycle metering by a multimeter. Taking a frequency value I see total program loop speed. Taking duty cycle I see which fraction of time is occupied by the part of program which I've marked by BSET/BCLEAR assembler instructions. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475 浏览 0 评论
5795 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1125浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1098浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 18:47 , Processed in 1.260574 second(s), Total 108, Slave 91 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
511