完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我有一个包含PIC32 MX664 F128H的系统,它控制几个电磁铁阵列的开关。在PCB设计中实现了对PIC的不稳定电源的所有“标准”预防措施(充足的去耦帽、4层PCB、信号到开关电路的光隔离、单独的电源连接和分/不共享的理由等)。是PIC在正常使用期间断续重置。这些重置发生在恒定操作的5到25分钟之间,并且没有特定的电磁开关序列可以确定为复位的原因。在一系列调试测试中,确定RCON寄存器中的空闲(唤醒空闲标志)位在启动时被设置。根据PIC的数据表,空闲状态是通过发布等待指令来实现的,这是我的源代码中任何地方都没有发生过的事情。似乎所有的东西都指向设备处于闲置状态,但它不合计。由于PCB布局包括对PIC的不稳定电源的一些预防措施,我对这可能是问题的严重怀疑。此外,BOR(Brown out Read)位在这样的重置期间从未设置,除了上电复位(连同POR位,这对于系统启动来说是完全正常的)。因为在我的源代码中没有等待指令,什么会导致PIC突然进入空闲状态?异常(比如堆栈溢出或堆栈下溢)会导致此重置事件吗?它还能与电力有关吗?模块配置中的某个东西会为这一事件打开大门吗?所使用的配置比特如下:使用的唯一中断是来自不同子系统的UART数据接收。但是,我不确定是否有一些随机中断标志可能在操作期间被设置(无意中),因为没有中断服务例程。
以上来自于百度翻译 以下为原文 I have a system containing a PIC32MX664F128H that controls the switching of several arrays of electromagnets. All the "standard" precautions against an unstable power supply to the PIC have been implemented in the PCB design (ample decoupling caps, 4-layer PCB, optical isolation of signals to the switching circuitry, separate power connections and divided/unshared grounds, etc.). The issue that I am facing is that the PIC resets intermittently during normal usage. These resets occur between 5 to 25 minutes of constant operation, and no particular sequence of electromagnet switching could be determined as the cause of the resets. During a series of debugging tests it was determined that the IDLE (Wake From Idle Flag) bit in the RCON register was set at startup (after the reset occurred). According to the PIC's datasheet, it seems that the idle state is achieved through issuing the WAIT instruction - something that never happens anywhere in my source code. Everything seems to point to the device being put into idle mode, but it just doesn't add up. Since the PCB layout includes a number of precautions against an unstable power supply to the PIC, I have serious doubts that this could be the issue. Furthermore, the BOR (brown-out reset) bit is never set during such a reset, except for a power-on reset (along with the POR bit, which is totally normal for a system startup). Since there is no WAIT instruction in my source code, what could cause the PIC to suddenly go into the idle state? Could an exception (like a stack overflow or stack underflow) cause this reset event? Could it still be power related? Could something in the configuration of the module open a door to this happening? The configuration bits as used are given below: // DEVCFG3 //#pragma config PMDL1WAY = OFF // Peripheral Module Disable Configuration (Allow multiple reconfigurations) //#pragma config IOL1WAY = OFF // Peripheral Pin Select Configuration (Allow multiple reconfigurations) //#pragma config FUSBIDIO = OFF // USB USID Selection (Controlled by the USB Module) //#pragma config FVBUSONIO = OFF // USB VBUS ON Selection (Controlled by USB Module) // DEVCFG2 /* see DEFINES section for further details on oscillator configuration */ #pragma config FPLLIDIV = DIV_2 // PLL Input Divider (2x Divider) #pragma config FPLLMUL = MUL_20 // PLL Multiplier (20x Multiplier) #pragma config FPLLODIV = DIV_1 // System PLL Output Clock Divider (PLL Divide by 2) //#pragma config UPLLIDIV = DIV_1 // USB PLL Input Divider (12x Divider) //#pragma config UPLLEN = OFF // USB PLL Enable (Disabled and Bypassed) // DEVCFG1 #pragma config FNOSC = FRCPLL // Oscillator Selection Bits (Fast RC Osc with PLL (FRCPLL)) #pragma config FSOSCEN = OFF // Secondary Oscillator Disnable (Disabled) #pragma config IESO = ON // Internal/External Switch Over (Enabled) #pragma config POSCMOD = OFF // Primary Oscillator Configuration (Primary osc disabled) #pragma config OSCIOFNC = OFF // CLKO Output Signal Active on the OSCO Pin (Disabled) #pragma config FPBDIV = DIV_1 // Peripheral Clock Divisor (Pb_Clk is Sys_Clk/1) #pragma config FCKSM = CSECMD // Clock Switching and Monitor Selection (Clock Switch Disable, FSCM Disabled) #pragma config WDTPS = PS1048576 // Watchdog Timer Postscaler (1:1048576) //#pragma config WINDIS = OFF // Watchdog Timer Window Enable (Watchdog Timer is in Non-Window Mode) #pragma config FWDTEN = OFF // Watchdog Timer Enable (WDT Disabled (SWDTEN Bit Controls)) //#pragma config FWDTWINSZ = WISZ_25 // Watchdog Timer Window Size (Window Size is 25%) // DEVCFG0 //#pragma config JTAGEN = OFF // JTAG Enable (JTAG Disabled) #pragma config ICESEL = ICS_PGx1 // ICE/ICD Comm Channel Select (Communicate on PGEC1/PGED1) #pragma config PWP = OFF // Program Flash Write Protect (Disable) #pragma config BWP = OFF // Boot Flash Write Protect bit (Protection Disabled) #pragma config CP = OFF // Code Protect (Protection Enabled) The only interrupt used is for UART data reception from the a different subsystem. However, I am not sure if some random interrupt flag could potentially (and unintentionally) be set during operation, for which there is no interrupt service routine. Any help would be greatly appreciated. |
|
相关推荐
3个回答
|
|
电路中没有电磁铁的软件工作吗?Ruben
以上来自于百度翻译 以下为原文 Does the software work without the electromagnets in the circuit? /Ruben |
|
|
|
这是我还没有测试的东西。我将测试它没有电磁铁和报告。除了发出等待指令,还有什么可以使PIC进入空闲模式?
以上来自于百度翻译 以下为原文 This is something that I have yet to test. I will test it without the electromagnets and report back. Other than issuing the WAIT instruction, what else could cause the PIC to enter idle mode? |
|
|
|
虽然在程序内存中没有等待指令,但它可能会出现在某个点的数据存储器中。如果执行路径有一些错误(例如,因为您损坏了堆栈和返回地址,或者您有一个函数指针有一个巨大的错误),那么您的执行可能跳转到一个最终执行等待指令的位置。但这种情况不太可能重复发生,除非您在某个地方拥有等待指令的数据,并且以非常特定的方式破坏堆栈。大多数情况下,你只会得到一个正常的异常或简单的表填充异常。所以我对你的情况没有一个真实的想法。首先你可以实现异常处理程序(参见编译器用户指南中的14.5)。然后我认为应该有一些处理程序(我想是NMIIHANDLE()),您可以实现它来查找等待指令的地址(或它后面的指令)。也许这给了你一个线索。
以上来自于百度翻译 以下为原文 Although you don't have the wait instruction in program memory it might appear in data memory at some point. If your execution path has some errors (for example because you corrupt your stack and the return address, or you have a huge error with a function pointer) your execution might jump to a place where it will finally execute the wait instruction. But it is unlikely that this really happens repeatedly, unless you have the data with the wait instruction at a certain place and corrupt the stack in a very certain way. Most of the time you would just get a normal exception or simple table refill exception. So I don't have a real idea about your case. First you could implement the exception handlers (see 14.5 in the Compiler User's Guide). Then I think there should be some handler (I think it is _nmi_handler() ) which you could implement to find out the address of the wait instruction (or the one after it). Maybe this gives you a clue whats going wrong. |
|
|
|
只有小组成员才能发言,加入小组>>
5234 浏览 9 评论
2026 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3201 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
771浏览 1评论
659浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
588浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
670浏览 0评论
571浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-20 14:59 , Processed in 1.299967 second(s), Total 82, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号