完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,AllI有一个非常困难的问题:(经过几天的正常工作,DSPIC30F5011卡在一个未知的状态。只有重置可以释放它。两个提示:1。SW实现16秒看门狗,在这个问题STATE2中似乎没有激活。SW实现休眠模式3。我确信睡觉后,看门狗被启用(制作测试)4。当CPU被卡住时,我可以通过示波器看到XTAL振荡器是活动的-我断定它目前不在睡眠模式5。通过MCLR引脚使CPU复位,使其返回到DIFSP30F5011到LIFL6就足够了。我运行所有的“永远循环”,我没有发现任何可能导致这个问题,特别是因为看门狗假定是Actuvi7。我正在使用两个CAN总线。所有陷阱只实现ASM(“重置”),除了实现“InSCONTROBER失败”,实现ItCON1BITS OSCWORKS=0;γ-DelayyMS(900);ASM(“RESET”);9。在我测试的一个单元中,CPU似乎在唤醒后重置自己。奇怪。我现在正在检查勘误表。没有发现任何特殊的,但仍在检查…谢谢大家,即使是阅读到目前为止:最好的
以上来自于百度翻译 以下为原文 Hi All I have a very hard problem :( After couple of days working correctly, the dspic30f5011 gets stuck in an unknown state. Only Reset can free it. couple of hints: 1. The SW implements 16 seconds Watchdog which does not seems to be activated in this issue state 2. The SW implements sleep mode 3. I made sure that after sleep, watchdog is enabled (made test) 4. While CPU is stuck, i can see via osciloscope the XTAL oscillator is active - i concluded it is NOT currently in sleep mode 5. It is enough to make a CPU Reset via MCLR pin to return it the dspic30f5011 to life 6. I run over all "forever while loops" and i didn't find anything that can cause the issue, especially since Watchdog assumes to be active 7. I am using two of the CANbus 8. All traps implements only asm("RESET") besides "_OscillatorFail" which implements INTCON1bits.OSCFAIL = 0; __delay_ms(900); asm("RESET"); 9. In one unit i tested, it seems the CPU resets itself after wakeup. Strange. 10. I am now checking the Errata. Didn't find anything special yet but still checking... Thank you all, even for reading so far :) Best Regards Ran |
|
相关推荐
10个回答
|
|
您可以通过将晶体引脚短路或将OSCI短路到地面而引起振荡器故障。UART调试可以简单地为两个步骤。检查枯萎的TX缓冲区是否免费。如果不做任何事,继续下一个代码。如果它已经准备好传输,那么只发送一个字节——一个函数或代码块号。我可以用便宜的USB到串行转换器实现2UMUDs的快速UART速度。最重要的是确保在VDD上没有PIC引脚的偏置。另一方面,在VDD上拔出一个引脚将在芯片中注入电流,并可能损坏内部RC振荡器操作,甚至是用于看门狗的LPRC。模拟功能引脚是最值得怀疑的。
以上来自于百度翻译 以下为原文 You can induce oscillator failure by shorting crystal pins together or by shorting OSCI to the ground. The UART debug may be as simple as two steps. Check wither TX buffer is free or not. If not do nothing, continue next code. If it's ready for transmission then transmit just a single byte - a function or code block number. I was able to achieve as fast UART speed as 2Mbauds with cheap USB-to-serial converter. Most important is to ensure there are none biasing of the PIC pins over the Vdd. AFAIK the pulling up of a pin over the Vdd will inject a current somewhere into the chip and may corrupt internal RC oscillator operation, even LPRC which is used for watchdog. Analog function pins are most suspectable. |
|
|
|
我注意到0.035V以上的VDD,即5.035V。似乎可以通过LM29 3D-5.0R2G DS
以上来自于百度翻译 以下为原文 I am noticing 0.035V over VDD i.e. 5.035V. Seems OK by LM2931D-5.0R2G DS |
|
|
|
真的!我似乎复制了这个问题:当模拟振荡器陷阱时,CPU挂起。我很高兴我尝试了你的“水晶短路”毕竟!所以……看来我正在处理振荡器陷阱。HMMI当前正在使用下一个处理程序
以上来自于百度翻译 以下为原文 Wow! It seems i managed to replicate the issue :) The CPU hangs when simulating oscillator trap. i am so glad i tried your "Crystal short circuit" after all! :) So........................... It seems i am handling the Oscillator trap wrong. hmmm I am currently using the next handler void __attribute__ ( (__interrupt__, auto_psv) ) _OscillatorFail (void) { INTCON1bits.OSCFAIL = 0; __delay_ms(900); Pic30Reset(); } |
|
|
|
PIC30REST();重置PIC?让我们假设YouRooSculalAtter失败。重置,重新启动,然后重置……为什么你的漫游者失败了?你有一个问题。你可以选择切换到内部振荡器并继续。
以上来自于百度翻译 以下为原文 Pic30Reset(); resets the PIC? Lets assume your Oscillator fails. Reset, the Reboot, then Reset... Why is your Oscillator failing? You have an issue there. You do have the option to switch to the internal oscillator and continue. |
|
|
|
嗨,NKurZman *定义PIC30RESET()ASM(“重置”)不确定你的意思是重置,然后重新启动,然后重置……你可以写你建议的SurvivalHuffer-Hunter函数吗?我不知道为什么振荡器失灵,但似乎很少见,每隔几天。虽然我确实在某个批次中发现了另一个现象,但我认为可能是相关的,我首先要确保我正确地处理了振荡器振荡器陷阱。
以上来自于百度翻译 以下为原文 Hi NKurzman #define Pic30Reset() asm("RESET") Not sure what you mean by Reset, then Reboot, then Reset... Might you write your suggested _OscillatorFail handler function? And i am not sure why the oscillator fails but it seems rare, every couple of days. Although i did find another phenomenon in a certain batch i think might be related, i would first like to make sure i am handling the _OscillatorFail trap correctly |
|
|
|
SySurror失败也可能与Eng21项相关,但在DS OSCCon & lt;3和gt;CF:时钟失效状态位中,我不确定。白色“1”意味着“FSCM已经检测到时钟故障”。如果我没有通过配置位启用FSCM,这是否也相关?我应该启用它吗?它说:“如果这个比特是明确的,立即从陷阱服务程序返回”。这意味着我应该保持一个循环,直到清楚,正确?不管怎样,根据我的理解,我实现了下一个手持机,但至少在模拟振荡器陷阱时,通过短路XTAL管脚(我认为它不模拟实际勘误表21),但CPU仍然挂在一个未知的状态(PS:看门狗是活动的,但未激活):
以上来自于百度翻译 以下为原文 The _OscillatorFail might also be related to errata item #21 But i am not sure in a couple of things
Anyway, according to my understanding i implemented the next handler void __attribute__ ( (__interrupt__, auto_psv) ) _OscillatorFail (void) { while(OSCCONbits.CF == 1) { INTCON1bits.OSCFAIL = 0; } } But at least when simulating an Oscillator trap by short circuit the XTAL pins (which i do not think simulates the actual errata #21) it did not, the CPU still hangs in an unknown state (ps: Watchdog is active but not activated) :( |
|
|
|
以上来自于百度翻译 以下为原文 void __attribute__ ( (__interrupt__, auto_psv) ) _OscillatorFail (void) { INTCON1bits.OSCFAIL = 0; __delay_ms(900); Pic30Reset(); // reset the PIC } after the reset what happens if the Oscillator does not recover, you are in a loop. Is the Failsafe clock monitor on (FSM)? then you could be in a loop If not, you could be dead if the Oscillator stops, you will never make it to the trap.. |
|
|
|
所以,可能是花了几个小时,但我似乎不能用FSCM做时钟切换,即使是在启动时,在配置模块中激活FSCM之后,我添加了这个模块。FSCMGIN在STARTUP之后被调用,但是我似乎不能改变OSCCONLL和OSCCONH,尽管它是保护的。离子程序:
以上来自于百度翻译 以下为原文 So, it might be the hours spent, but i can't seem to make a clock switch using the FSCM, even on startup After activating the FSCM in configuration bits i added this module The FSCM_Init is called after startup void FSCM_Init(void) { FSCM_SetPrimary(); } void FSCM_SetPrimary(void) { //Note: If the destination clock source is a crystal oscillator, the clock switch time will be dominated by the oscillator start-up time. //Note: dspic30f5011 uses OSCCON version 2 //TODO: should i consider OSCCONbits.CF before setting oscillator? if (OSCCONbits.COSC != 3) { //TODO: should i first check if oscillator stable or something? INTCON1bits.OSCFAIL = 0; u16 SR_temp; SR_temp = SR; SR |= 0xE0; //Disable interrupts by rasing highest priority OSCCONH = 0x78; OSCCONH = 0x9A; OSCCONH |= 3; OSCCONL = 0x46; OSCCONL = 0x57; OSCCONL |= 1; //Wait until switching complete //TODO: add a time condition and if expires try again? while(OSCCONbits.COSC != G_FSCM_COSC_PRIMARY) { //Counting on watchdog in case any problem //TODO: make sure Watchdog is active by trying while(1) } SR = SR_temp; //Enable interrupts } } But i don't seem to be able to change the OSCCONL & OSCCONH although making the protection procedure :( |
|
|
|
您必须使用内置函数或使用ASM,因为它们必须在正确的循环量中完成。手动设置它们是行不通的。
以上来自于百度翻译 以下为原文 You have to use the built in functions or use asm since they have to be done in the correct amount of cycles. Setting them manually will never work. ;unlock pin mapping mov #0x46,w1 mov #0x57,w2 mov #OSCCON,w3 mov.b w1,[w3] mov.b w2,[w3] bset OSCCON,#6 ;IOLOCK ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;if still 0, mapping not available btss OSCCON,#6 ;IOLOCK bra error_map |
|
|
|
在IRQ中插入一些文本,或者打开一个Le..ValueAy属性((中断,NoAutoNo.PSV))。
以上来自于百度翻译 以下为原文 Put some text in the irq or turn on an led. void __attribute__((interrupt, no_auto_psv)) _AddressError(void){ puts("TRAP:ADDRESS ERROR"); for(;;); } |
|
|
|
只有小组成员才能发言,加入小组>>
5244 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3209 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2260 浏览 5 评论
779浏览 1评论
672浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
598浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
682浏览 0评论
579浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 13:27 , Processed in 1.690817 second(s), Total 94, Slave 78 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号