完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我正在调试一个新的使用PIC18f25k50的u***供电的设计。我遇到的问题是,每当我试图把时钟改为16Mhz内部振荡器(从默认的1Mhz)时,电路板就会复位(调试器停止,然后转到PC=0)。8Mhz及以下工作正常,但在16Mhz时将立即复位。在调试过程中,我还发现:设置PLL_EN=on也会导致复位。从端口RC2驱动外部LED也会导致复位(大约8ma电流)。E毛刺由(略)更高的电流消耗引起。该设计已经在VDD/GND上有0.1UF上限,并且完全吸引了大约20Ma。我增加了另一个10UF到VDD/GND,但这没有效果。我还在MCLRb上加了0.1uF帽,但没有效果。只是帽子,MCLRb,USB连接,和LED(通常关闭)上拉。有什么想法?MPLABX,C18,pickit 3Startup代码和配置选项如下:#pragma配置CFGPLLEN=OFF//pll off on start#pragma配置CPUDIV=NOCLKDIV//使用48MHz时钟作为cpu时钟=48MHz/1=48MHz////pragma配置CPUDIV=CLKDIV2//使用24MHz时钟作为cpu时钟=48MHz/2=24MHz#pragma配置LS48MHSYS48X8//系统时钟是48Mhz=SYS48X8//系统时钟是48Mhz#pragma配置FOSC=INTOSCIO//内部振荡器,\#pragma配置IESO IESO IESO=OFF///\\\\#pragma配置配置IESO配置IESO IESO IESO IESO IESO IESO IESO=OFF=OFF//////\\\\\\\\\gBORV=190#pragma配置WDTEN=OFF#pragma config WDTPS=32768#pragma config CCP2MX=RB3//#pragma config CCP2MX=RC1#pragma config PBADEN=OFF#pragma config SDOMX=RC7#pragma config MCLRE=ON//使用mclrB重置输入//#pragma config DEBUG=ON//RB6和RB7作为调试器。#pragma配置XINST=OFF//扩展指令.=off#pragma配置STVREN=ON#pragma配置LVP=OFFStartup code://禁用一些默认ADCON1|=0b1111;//all pins.//CVRCON=0b00000000;//set.(.)//大多数设置都在配置位中(io_cfg.h)。OSCCON2bits.INTSRC=1;OSCCON2bits.OSCCON2bits.PLLEN=0;//pll必须被禁用以控制OSCTUNEbits.PLCLONONONONONON2比特.PLLELEN=0;//pll必须被禁用以控制OSCTUNUNUNEbits.PLCTONEbits.PLUNONONONONONONONONONONON比特=0;//SPLLPLCLCLCLMUMULT=1;//3xplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplplpll//OSCTUNEbits.SPLLMULT=1 int//这是c引发崩溃/重置OSCCONbits.IRCF=0x6;//8Mhzint//这还可以//OSCCON=0x70;//使用内部时钟(16MHzxtalx3PLL=48MHz),同时(!OsCONBITS.HFIFOs){}//OsCON2BIT.PLLEN=1;//这一个也会崩溃我们/ /()!{UCFGbits.PLLRDY){{{UCFGbits.FSEN=1;//启用全速u*** ACTCON比特.ACTSRC=1;//启用全速u*** ACTCON比特.ACTCON比特.ACFGbits.PLLRDY){{{UCFG比特.FSEN=1;///启用全速u*** u*** ACTCONbits ACTCON比特.ACTSRCRCRCRCRCRCRCRCRC=1;//u*** u***源ACTCON比特/u***源ACTCON比特=1;///启用主动调谐//设置IR IO//启用激活调谐//设置IR IO//所有IO//所有IO//除了调试器LATC=0xff;//LED OFF//TRISC=0x03;//除了1/0TRISC=0xfb之外的所有输出;//除了2 LATC=0xf0;//LED ON之外的所有输入,这会导致崩溃(驱动外部LED,8mA)ANSELC=0;
以上来自于百度翻译 以下为原文 I am debugging a new u*** powered design using the PIC18f25k50. The problem I am running into is the board will reset (debugger stalls then goes to PC=0) whenever I try to change the clock to 16Mhz internal oscillator (from the default 1 Mhz). 8 Mhz and below works ok, but at 16Mhz it will immediately reset every time. In the debug process, I have also found that: Setting PLL_EN = on will also cause the reset Driving an external LED from port RC2 will also cause the reset (around 8ma of current) These made me think the problem was a voltage glitch causes by (slightly) higher current consumption. The design already had a 0.1uF cap on VDD/GND and totally draws around 20mA. I added another 10uF to VDD/GND but this had no effect. I also added 0.1uF cap on MCLRb still with no effect. There is very little external circuitry. Just the caps, pull ups on MCLRb, USB connection, and the LEDs (normally off). Any ideas? MPLABX, C18, pickit 3 Startup code and config options below: #pragma config CFGPLLEN = OFF // pll off on startup #pragma config CPUDIV = NOCLKDIV //Use 48MHz clock for cpu clock = 48MHz/1 = 48MHz //#pragma config CPUDIV = CLKDIV2 //Use 24MHz clock for cpu clock = 48MHz/2 = 24MHz #pragma config LS48MHZ = SYS48X8 //system clock is 48Mhz #pragma config FOSC = INTOSCIO // Internal oscillator, #pragma config IESO = OFF //#pragma config FCMEN = OFF #pragma config FCMEN = ON //#pragma config PWRTEN = OFF #pragma config BOREN = ON //#pragma config BOREN = OFF #pragma config BORV = 190 #pragma config WDTEN = OFF #pragma config WDTPS = 32768 #pragma config CCP2MX = RB3 //#pragma config CCP2MX = RC1 #pragma config PBADEN = OFF #pragma config SDOMX = RC7 #pragma config MCLRE = ON // use mclrB reset input //#pragma config DEBUG = ON // RB6 and RB7 for debugger.. #pragma config XINST = OFF // extended instruction enable = off #pragma config STVREN = ON #pragma config LVP = OFF Startup code: //disable some defaults ADCON1 |= 0b1111; //all pins digital //CVRCON = 0b00000000; // set clock (internal) // most of the settings are in the configuration bits (io_cfg.h) OSCCON2bits.INTSRC = 1; OSCCON2bits.PLLEN = 0; // pll must be disable to control OSCTUNEbits.SPLLMULT = 1; //3xpll //OSCTUNEbits.SPLLMULT = 0; //4xpll //OSCCONbits.SCS = 0x3; OSCCONbits.SCS = 0x0; // should use pll clock output for system clock //OSCCONbits.IRCF = 0x7; //16Mhz int // this was causing crash/reset OSCCONbits.IRCF = 0x6; //8Mhz int // this is ok //OSCCON = 0x70; // use internal clock (16MHz xtal x3PLL = 48MHz) while (!OSCCONbits.HFIOFS){} //OSCCON2bits.PLLEN = 1; // this one also crashes us //while (!OSCCON2bits.PLLRDY){} UCFGbits.FSEN = 1; // enable full speed u*** ACTCONbits.ACTSRC = 1; // u*** source ACTCONbits.ACTEN = 1; // enable active tuning // set IR IO // all IO default to inputs TRISA = 0xff; // all inputs //TRISA = 0x00; // all outputs TRISB = 0xff; // all inputs //TRISB = 0xc0; // all outputs except debugger LATC = 0xff; // LED OFF //TRISC = 0x03; // all outputs except 1/0 TRISC = 0xfb; // all inputs except 2 LATC = 0xf0; // LED ON this causes crash (drives external LED, 8mA) ANSELC = 0; |
|
相关推荐
14个回答
|
|
|
嗨,欢迎来到微芯片社区。这可能是猜测。首先执行配置设置1)将模拟更改为数字2)使用TRISC=0x00,TRISC=0xFF3设置输出引脚)然后执行LAT=0x00发布完整的程序。
以上来自于百度翻译 以下为原文 Hi, Welcome to the Microchip community. This May be Guess . First do Configuration setting 1) Change Analog to Digital 2) Set Output Pins with TRISC = 0x00,TRISC = 0xFF 3) Then do LAT = 0x00 Post your complete program.. Regards *TS9* |
|
|
|
|
|
您好,1)您是否遵循“VUSB3V3”的数据表建议,在“F”部分使用从VUSB3V3到Vss的电容器?2)这个问题只发生在调试模式(即单步)吗?如果在代码中节流时钟并以非调试构建运行部件的代码点之后切换输出行,您看到端口引脚切换了吗?发布你的示意图可以让社区更快地帮助你。最好的问候,肯。
以上来自于百度翻译 以下为原文 Hello, 1) Are you following the Data Sheet recommendations for 'VUSB3V3' by using a capacitor from it to Vss on the 'F' part? 2) Is this issue only happening in debug mode (i.e. when single-stepping)? If you toggle an output line after the point in code code that throttles up the clock and run the part with a non-debug build do you see the port pin toggle? Posting your schematic may allow the community to help you quicker. Best regards, Ken |
|
|
|
|
|
这里是整个程序直到它失败的地方:void main(void){static BYTE ledtrig;BYTE OutByte;Setup.();//设置硬件,USB.....setupboard总是失败,因此剪辑herevoidSetup.(void){unsigned int cnt;//禁用一些默认ADCON1|=0b1111;//所有引脚数字//CVRCON=0b//定时器(内部)//定时器(内部)//大部分设置都在配置位(io_cfg.h)OSCCON2bits.OSCCON2bits.INTSRC=1;OSCCON2bits.INTSRC=1;OSCCON2bits.OSCCON2bits.PLLEN=0;//pll必须被禁用才能控制OSCTUNUNUNUNEbits.SPLLUNEbits.SPLLMUMULT=1;//3xpll//OSCTUNUNUNUNUNUNEEEEEEBSPLL(内部//3xpll//OSCTCTCTUNUNUNEEEEEBSPLL(SPLL.SPLLMUMUMUMULT=0=0=0)////应该为系统时钟//OSCCONbits使用pll时钟输出。IRCF=0x7;//16Mhzint//这是导致崩溃/重置OSCCONbits.IRCF=0x6;//8Mhzint//这是确定//OSCCON=0x70;//使用内部时钟(16MHzxtalx3PLL=48MHz)同时(!OsCONBITS.HFIFOs){}//OsCON2BIT.PLLEN=1;//这一个也会崩溃我们/ /()!{UCFGbits.PLLRDY){{{UCFGbits.FSEN=1;//启用全速u*** ACTCON比特.ACTSRC=1;//启用全速u*** ACTCON比特.ACTCON比特.ACFGbits.PLLRDY){{{UCFG比特.FSEN=1;///启用全速u*** u*** ACTCONbits ACTCON比特.ACTSRCRCRCRCRCRCRCRCRC=1;//u*** u***源ACTCON比特/u***源ACTCON比特=1;///启用主动调谐//设置IR IO//启用激活调谐//设置IR IO//所有IO//所有IO//除了调试器LATC=0xff;//LED OFF//TRISC=0x03;//除了1/0TRISC=0xfb;//除了2 LATC=0xf0;//LED ON ANSELC=0;。剪辑在这里,因为它会失败。iSCCF=0x7;//16MHz INT//这导致崩溃/RESETB。OSCCON2bits.PLLEN=1;//根据我对配置位的注释,这一个也会使usor C.LATC=0xf0;//LEDON崩溃。
以上来自于百度翻译 以下为原文 Here is the whole program up to where it fails: void main(void) { static BYTE ledtrig; BYTE OutByte; SetupBoard(); //setup the hardware, USB .....setupboard always fails, so clipping here void SetupBoard(void) { unsigned int cnt; //disable some defaults ADCON1 |= 0b1111; //all pins digital //CVRCON = 0b00000000; // set clock (internal) // most of the settings are in the configuration bits (io_cfg.h) OSCCON2bits.INTSRC = 1; OSCCON2bits.PLLEN = 0; // pll must be disable to control OSCTUNEbits.SPLLMULT = 1; //3xpll //OSCTUNEbits.SPLLMULT = 0; //4xpll //OSCCONbits.SCS = 0x3; OSCCONbits.SCS = 0x0; // should use pll clock output for system clock //OSCCONbits.IRCF = 0x7; //16Mhz int // this was causing crash/reset OSCCONbits.IRCF = 0x6; //8Mhz int // this is ok //OSCCON = 0x70; // use internal clock (16MHz xtal x3PLL = 48MHz) while (!OSCCONbits.HFIOFS){} //OSCCON2bits.PLLEN = 1; // this one also crashes us //while (!OSCCON2bits.PLLRDY){} UCFGbits.FSEN = 1; // enable full speed u*** ACTCONbits.ACTSRC = 1; // u*** source ACTCONbits.ACTEN = 1; // enable active tuning // set IR IO // all IO default to inputs TRISA = 0xff; // all inputs //TRISA = 0x00; // all outputs TRISB = 0xff; // all inputs //TRISB = 0xc0; // all outputs except debugger LATC = 0xff; // LED OFF //TRISC = 0x03; // all outputs except 1/0 TRISC = 0xfb; // all inputs except 2 LATC = 0xf0; // LED ON ANSELC = 0; .. clipped here because it will fail at either A. OSCCONbits.IRCF = 0x7; //16Mhz int // this was causing crash/reset B. OSCCON2bits.PLLEN = 1; // this one also crashes us or C. LATC = 0xf0; // LED ON depending on what I comment out The configuration bits should be set by the #pragma statements in the original post (they are included as .h file) |
|
|
|
|
|
当尝试上传示意图(JPG文件)时,我得到“拒绝访问”。有没有办法让它上传?我在VISB33引脚上有0.47μF的上限(在那个引脚上没有其他的)。该板是手工建造的,因此在那里可能会有不良的焊接连接。我会检查的,如果没有拾取3,它仍然会发生。我可以看到LED几乎闪烁,然后它复位(假设我注释时钟=16mhz和锁相环启用,使它能够启用LED)。
以上来自于百度翻译 以下为原文 I'm getting "access denied" when trying to upload the schematic (jpg file). Is there a trick to getting it to upload? I do have the 0.47uF cap on VUSB33 pin (and nothing else on that pin). The board is built by hand, so it could be possible to have a bad solder connection there. I will check it. It does still happen without the pickit 3 attached. I can see the LED barely blink then it resets (assuming I commented out the clock=16mhz and pll enable so that it makes it to enabling the LED). |
|
|
|
|
|
我猜是BOR(棕色输出重置)。你用BOR关过了吗?你的电源可能无法以更高的时钟速度提供足够的电流。
以上来自于百度翻译 以下为原文 My guess is a BOR (brown out reset). Have you tried this with the BOR turned OFF? You rpower source may not be capable of providing sufficient current at the higher clock speed. |
|
|
|
|
|
我确实尝试关掉BOR,没有变化。我已经尝试了几种不同的USB主机设备来供电。不过,我们应该远远没有达到目前的极限。我同意这似乎是一个权力问题,但不知道为什么目前的抽签和上限存在。
以上来自于百度翻译 以下为原文 I did try turning off BOR, no change. I have tried several different USB host devices to power it. We should be nowhere near the current limit though. I agree it seems like a power problem, but have no idea why given the current draw and cap present. |
|
|
|
|
|
您可以尝试重置后的RCON寄存器的值,并检查是否有任何有用的信息。
以上来自于百度翻译 以下为原文 You can try to dump the value of the RCON register after the reset, and check if there is any information helpful. |
|
|
|
|
|
RCON显示RIP=1 toB=1 PDB=1 PORB=0 BORB=0,看来它必须是上电复位,但没有道理。
以上来自于百度翻译 以下为原文 RCON shows RIb=1 TOb=1 PDb=1 PORb=0 BORb=0 Seems like it has to be power on reset, but doesn't make sense why |
|
|
|
|
|
也可能检查STKPTR寄存器STKFUL和STKUNF位,以排除在流上/流下的堆栈,只是为了确定。如果不启用USB外围设备怎么办?当LED被打开时,你会得到复位吗?
以上来自于百度翻译 以下为原文 Also possibly check STKPTR register STKFUL and STKUNF bits to rule out a stack over/under flow, just to be sure. Also what if you do not enable the USB peripheral? Do you get a reset when the LED is turned ON? |
|
|
|
|
|
|
|
|
|
|
|
你的照片的足迹是什么?尝试检查你的PICN的GND管脚的焊接,你是如何处理USB屏蔽的?
以上来自于百度翻译 以下为原文 what is the footprint of your pic? try to check soldering of the gnd pin of your pic. and how did you deal with u*** shielding? |
|
|
|
|
|
我有28个QFN软件包。引脚5和16和VSS/GND。引脚17是5V从USB(0.1UF和10UF上限到GND)。引脚11(VBUS33 V)是.47μF到GND。芯片上的电源焊盘也连接到板上的VSS。然而,由于这是用热枪手工焊接的,它可能没有良好的连接(没有粘贴到焊盘上)。USB屏蔽没有连接(使用非屏蔽电缆)。只有VDD/VSS/D+/D连接。
以上来自于百度翻译 以下为原文 I have the 28 QFN package. Pins 5 and 16 and VSS/GND. Pin 17 is 5V from USB (with 0.1uf and 10uf caps to gnd). Pin 11 (VBUS33V) is .47uF to GND. The power pad under the chip is also connected to VSS on the board. However, since this was hand soldered using a heat gun it likely does not have a good connection (no paste was applied to that pad). The USB shield is not connected (using an unshielded cable). Only VDD/VSS/D+/D- are connected. |
|
|
|
|
|
接地和电源连接不良是可能出现的问题:你可以测量相应的插脚和GND之间是否有5V或3.3V的可用;即使如此,试着紧固焊盘的连接:28QFN封装的GND插脚和USB连接器上的进口GND插脚。PIC16F1459有问题,我刚用拇指按PCB上的芯片时……它一次又一次地复位……直到GND引脚在PIC上双焊之后,一切正常。
以上来自于百度翻译 以下为原文 Poor connection of grounding and power are possible problems: you could measure if 5V or 3.3V are available between corresponding pins and GND; even so,try tighting connection of pads:GND pins of 28 QFN package,and the import GND pin on your USB connectors. Especially the grounding pins,i have similar problem with PIC16F1459,when i was just pushing the chip on my PCB by thumb...it was resetting again and again...things were in order until after double solderring of GND pin on PIC. |
|
|
|
|
|
我看不到任何重大的供应下降。几周后我会有一些机器组装的部件。希望他们表现得更好。
以上来自于百度翻译 以下为原文 I don't see any significant dips on the supplies. I will have some machine assembled units in a few weeks. Hopefully they behave better. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475 浏览 0 评论
5795 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1126浏览 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-3 11:07 , Processed in 1.322935 second(s), Total 98, Slave 81 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2260