PIC单片机上电不运行,请教什么原因?
PIC单片机 PIC18F26K80,故障现象电路连接
PC机------USB转CAN-------目标板--------稳压电源供电
上电后,单片机不运行,晶振工作正常
将示波器探头夹子和目标板地线连接,重新上电,工作正常
不知什么原因,如果修改
MCLR 有上拉电阻10K
configuration bits
#pragma config FOSC =???
#pragma config WDT = OFF
VCAP的106电容接了吗 Internal externel osc switch over 关了没 jack12345 发表于 2016-8-18 19:17
configuration bits
#pragma config FOSC =???
#pragma config WDT = OFF
// CONFIG1L
/*----------------------------------------------------------------
VREG Sleep Enable bit (Ultra low-power
regulator is Disabled (Controlled by REGSLP bit))
------------------------------------------------------------------*/
#pragma config RETEN = OFF
/*----------------------------------------------------------------
LF-INTOSC Low-power Enable bit (LF-INTOSC
in High-power mode during Sleep)
------------------------------------------------------------------*/
#pragma config INTOSCSEL = HIGH
/*----------------------------------------------------------------
SOSC Power Selection and mode
Configuration bits (High Power SOSC circuit selected)
------------------------------------------------------------------*/
#pragma config SOSCSEL = HIGH
#pragma config XINST = OFF // Extended Instruction Set (Enabled)
// CONFIG1H
/*----------------------------------------------------------------
Oscillator (HS oscillator (Medium power, 4
MHz - 16 MHz))
------------------------------------------------------------------*/
#pragma config FOSC = HS1
//#pragma config FOSC = INTIO2
#pragma config PLLCFG = ON // PLL x4 Enable bit (Enabled)
#pragma config FCMEN = OFF // Fail-Safe Clock Monitor (Disabled)
/*----------------------------------------------------------------
Internal External Oscillator Switch Over
Mode (Disabled)
------------------------------------------------------------------*/
#pragma config IESO = OFF
// CONFIG2L
#pragma config PWRTEN = ON // Power Up Timer (Disabled)
/*----------------------------------------------------------------
Brown Out Detect (Enabled in hardware,
SBOREN disabled)
------------------------------------------------------------------*/
#pragma config BOREN = SBORDIS
#pragma config BORV = 0 // Brown-out Reset Voltage bits (1.8V)
/*----------------------------------------------------------------
BORMV Power level (ZPBORMV instead of
BORMV is selected)
------------------------------------------------------------------*/
#pragma config BORPWR = HIGH
// CONFIG2H
/*----------------------------------------------------------------
Watchdog Timer (WDT disabled in hardware;
SWDTEN bit disabled)
------------------------------------------------------------------*/
#pragma config WDTEN = OFF
#pragma config WDTPS = 1048576// Watchdog Postscaler (1:1048576)
// CONFIG3H
/*----------------------------------------------------------------
ECAN Mux bit (ECAN TX and RX pins are
located on RB2 and RB3, respectively)
------------------------------------------------------------------*/
#pragma config CANMX = PORTB
/*----------------------------------------------------------------
MSSP address masking (7 Bit address
masking mode)
------------------------------------------------------------------*/
#pragma config MSSPMSK = MSK7
#pragma config MCLRE = OFF// Master Clear Enable (MCLR Enabled, RE3 Disabled)
// CONFIG4L
#pragma config STVREN = ON // Stack Overflow Reset (Enabled)
#pragma config BBSIZ = BB2K // Boot Block Size (2K word Boot Block size) 2005n2005 发表于 2016-8-18 20:14
Internal externel osc switch over 关了没
配置字见上面代码,关键是现在只要示波器的接地线夹子夹到我单片机的地线上,单片机就正常运行。 我做我的王 发表于 2016-8-18 19:25
VCAP的106电容接了吗
接了,,10uf测量电压约3.2v zhousun 发表于 2016-8-19 12:10
接了,,10uf测量电压约3.2v
好像是1.8V才算正常,你检查下供电的引脚,这是供电问题。我之前也遇到过,方便的话原理图贴出来帮你看看 我做我的王 发表于 2016-8-19 14:13
好像是1.8V才算正常,你检查下供电的引脚,这是供电问题。我之前也遇到过,方便的话原理图贴出来帮你看看 ...
好的,谢谢指导
页:
[1]