1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我使用PIC32 MZ2048 EFH064与外部振荡器(ASTMLPA-24.000兆赫)。PIC32 MZ被配置为SysCLK=252兆赫。3.3V轨连续切换开/关,并且执行的第一代码(即紧接在int()之后{)是驱动输出引脚。这允许PIC32 MZ的启动时间被测量为脉冲宽度,启动时间始终为90ms。我预期启动时间将是外部振荡器启动时间(最大5ms)和PLL启动/锁定时间(最大100μs)的总和。启动时间比预期的要大一个数量级,什么可以解释这个时间比预期的启动时间长?启用/禁用双速启动(IESO=ON/OFF)似乎不起作用。我能做些什么来减少启动时间?
以上来自于百度翻译 以下为原文 I am using a PIC32MZ2048EFH064 with an external oscillator (ASTMLPA-24.000MHz). The PIC32MZ is configured for SYSCLK = 252 MHz. The 3.3V rail is continuously toggled on/off and the first code executed (i.e. immediately after int main() {) is to drive an output pin. This allows the start-up time of the PIC32MZ to be measured as a pulse width. The start-up time is consistently ~90ms. I expected the start up time would be the sum of the external oscillator start up time (max. 5ms) and the PLL start-up/lock time (max. 100 us). The start-up time is almost an order of magnitude greater than expected. What could account for this longer than expected start-up time? Enabling/disable Two-Speed Start-up (IESO = ON/OFF) does not seem to have an effect. What can I do to reduce the start-up time? |
|
相关推荐
4个回答
|
|
你好,Sebmadgwick,让我们后退一步:帮助我们理解为什么90毫秒太长?当论坛社区了解这一点和您的需求时,可能会有不同的方式来解决这个问题。请记住,在主代码之前,有一个C启动代码在您的代码之前执行。我认为如果需要添加SP,可以使用一个ONYREST()名称(不知道是不是名称)。EIAI自定义代码早于主()。在XC32用户指南中查看更多细节。我不精通ONYREST(),或者修改MIPS架构的C运行时启动代码,但是社区里有很多MIPS专家。再次,知道为什么90毫秒是不可接受的是第一个启发我们的。我希望这有点帮助。最好的问候,肯。
以上来自于百度翻译 以下为原文 Hello Sebmadgwick, Let's take a step back: Help us understand why 90 ms is too long? There may be a different way to solve the problem once the Forum Community understands this and your requirements. Remember that there is C start-up code that executes before your code at main(). I think there is an on_reset() hook (not sure if that is the name) that can be used if you need to add special custom code earlier than main(). Take a look in the XC32 User's Guide for more details. I'm not well-versed in on_reset() or modifying the C run-time start-up code for the MIPS architecture but there are a lot of MIPS experts here in thsi community. Again, knowing why 90 ms is not acceptable is the first thing to enlighten us on. I hope this helps somewhat. Best regards, Ken |
|
|
|
+1i怀疑OP根本不允许这样做。MIN()不是PIC运行的第一个代码。所有全局变量都将被初始化,加上编译器需要设置的其他内容,然后运行主()。
以上来自于百度翻译 以下为原文 +1 I suspect the OP did not allow for this at all. main() is NOT the first code the PIC runs. All the global variables will be initialised, plus whatever else the compiler needs set up, THEN main() is run. |
|
|
|
嗨,我想Ken Pergola还是很不错的。在C编译器安装V1.43和以前,有C代码运行时提供的源代码,以及它提供的各种钩子。在我的Windows安装中,它是在:C:程序文件(x86)Microchip xC32 V1.43PIC32 LIBSPIC32 LIBS.zip LIBPIC。32个存根Debug OnReSt.cand有这样的内容:如果您将一个拷贝复制到您的项目源代码中,删除文件名的“Debug”部分和弱属性,则应该有一个空函数,在C运行时启动时将被调用。从程序代码中调用的函数名使用了一个前导下划线,但是当C编译器生成目标代码时,它会将前导下划线添加到C代码函数名中。如果在ON-Read(空)函数中切换一个PIN,则可以得到一个指示。所使用的时间是由于硬件或软件占用时间。注意,为了得到合理的测量,程序运行必须是一个生成构建。在调试建立之前,将在调用OnAuthReStE()函数之前启动调试器。迈西尔
以上来自于百度翻译 以下为原文 Hi, I think Ken Pergola remember or guess pretty good. In C compiler installation v1.43 and previous, there are source code provided for C runtime startup, and the various hooks it provide. In my windows installation it is in: C:Program Files (x86)Microchipxc32v1.43pic32-libspic32-libs.ziplibpic32stubsdefault-on-reset.c and have this content: /********************************************************************* * * Default _on_reset Implementation * ********************************************************************* * Filename: default-on-reset.c * * Processor: PIC32 * * Compiler: MPLAB C Compiler for PIC32 MCUs * MPLAB IDE * Company: Microchip Technology Inc. * * Software License Agreement * * The software supplied herewith by Microchip Technology Incorporated * (the 'Company') for its PIC32/PIC24F Microcontroller is intended * and supplied to you, the Company's customer, for use solely and * exclusively on Microchip PIC32/PIC24F Microcontroller products. * The software is owned by the Company and/or its supplier, and is * protected under applicable copyright laws. All rights are reserved. * Any use in violation of the foregoing restrictions may subject the * user to criminal sanctions under applicable laws, as well as to * civil liability for the breach of the terms and conditions of this * license. * * THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTIES, * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. * ********************************************************************/ /* This is a default definition of an _on_reset() function. * It does nothing and just goes returns. If the user * application supplies a handler function, this function will not be * referenced and thus not pulled in from the library. */ void __attribute__((weak)) _on_reset (void) { } If you make a copy into your project source code, remove the 'default_' part of the filename, and the weak attribute, you should have a empty function that will be called early in c runtime startup. I suspect however that the function name shown above is wrong, and that the leading underscore should not be there. The function name called from assembly code use a leading underscore, but when C compiler make object code, it add the leading underscore to C code function name. If you Toggle a Pin in on_reset(void) function, you may get a indication if the time used is due to hardware, or software taking time. Note, that to get sensible measurements, program running must be a production build. With a debug build, debugger will be started before on_reset() function is called. Mysil |
|
|
|
另一种方法,是检查“核心定时器”。当处理器复位时,MIPS性能计数器启动,从那里运行。当主()被输入时,计数寄存器应该包含硬件重启完成后软件启动所用的时间。除非有人在软件中做了一些愚蠢的事情,计数寄存器持续记录时间。In CPU被重置。在旧的PLIB中,看到了包含和lc:CP0DEFS.H&G.和宏:O.CP00GETYAQUTUTE()的代码,当没有充分的理由这样做时,错误地保持了清零性能计数器计数寄存器的代码。我怀疑这个错误也被重复到了和谐中。迈西尔
以上来自于百度翻译 以下为原文 Another way, is to examine the 'Core timer'. MIPS performance counter is started when processor is reset, and run from there. When main() is entered, Count register should contain the time used by software startup since hardware reset was completed. Unless someone do something stupid in software, Count register keep recording time continously since CPU was reset. See #include and macro: _CP0_GET_COUNT() In Legacy Plib, there is code that mistakenly keep clearing the performance counter Count register, when there is no good reason to do so. I suspect that this mistake was also repeated into Harmony. Mysil |
|
|
|
只有小组成员才能发言,加入小组>>
5237 浏览 9 评论
2027 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3202 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
772浏览 1评论
662浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
590浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
672浏览 0评论
572浏览 0评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-21 20:08 , Processed in 1.326735 second(s), Total 82, Slave 66 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号