PIC18F45K22
外部晶振是20MHz,电容是22p
配置位:#pragma config FOSC = XT // Oscillator Selection bits (XT oscillator)
#pragma config PLLCFG = OFF // 4X PLL Enable (Oscillator used directly)
#pragma config PRICLKEN = ON // Primary clock enable bit (Primary clock is always enabled)
#pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor disabled)
#pragma config IESO = ON // Internal/External Oscillator Switchover bit (Oscillator Switchover mode enabled)
寄存器
OSCCON和OSCCON2使用默认值
但是就一直不工作在外部晶振,都是在内部晶振工作
请高手指点下,哪里还需要设定吗?
谢谢!
|