CONFIG WDT = OFF ; Disable watchdog timer
CONFIG MCLRE = ON ; MCLEAR Pin on
CONFIG DEBUG = ON ; Enable Debug Mode
CONFIG LVP = OFF ; Low-Voltage programming disabled (necessary for debugging)
CONFIG FOSC = INTOSCIO_EC ; Internal oscillator, port function on RA6
; Oscillator Selection bits:
; FOSC = XT_XT XT oscillator, XT used by USB
; FOSC = XTPLL_XT XT oscillator, PLL enabled, XT used by USB
; FOSC = ECIO_EC External clock, port function on RA6, EC used by USB
; FOSC = EC_EC External clock, CLKOUT on RA6, EC used by USB
; FOSC = ECPLLIO_EC External clock,PLL enabled, port function on RA6,EC used by USB
; FOSC = ECPLL_EC External clock, PLL enabled, CLKOUT on RA6, EC used by USB
; FOSC = INTOSCIO_EC Internal oscillator, port function on RA6, EC used by USB
; FOSC = INTOSC_EC Internal oscillator, CLKOUT on RA6, EC used by USB
; FOSC = INTOSC_XT Internal oscillator, XT used by USB
; FOSC = INTOSC_HS Internal oscillator, HS used by USB
; FOSC = HS HS oscillator, HS used by USB
; FOSC = HSPLL_HS HS oscillator, PLL enabled, HS used by USB
Yes, of course I did. I tried two different 20MHz crystals, and tried both 15pF and 20pF capacitor pairs with them.bld said:It may be a really stupid question, but did you connect a crystal to your PIC?
Another point is that XT configuration is for oscillators less than 10MHz. If you use a quartz of 10MHz or more, you should use HS configuration.
I'm going to try this as soon as I arrive home. Thank you for your help.bld said:Another point is that XT configuration is for oscillators less than 10MHz. If you use a quartz of 10MHz or more, you should use HS configuration.
How can I load these configuration bits in my PIC?Colbhaidh said:Try using HS Oscillator, PLL enabled, HS used bu USB.
I use this all the time with 20MHz crystals.
The config locations for my settings are as follows
0E24
1E39
0100
0081
C00F
E00F
400F
Thank you for the image, but I think there's a problem. It is not displayed.vikrambgholap said:u must untick here
How can I load these configuration bits in my PIC?
Through the programmer kit or in my source code?
But how?bld said:I may recommend you to load the configuration words in the code, using CONFIG directive. I always set the configuration words in the code.
CONFIG 0E24
CONFIG 1E39
CONFIG 0100
CONFIG 0081
CONFIG C00F
CONFIG E00F
CONFIG 400F
__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC3_PLL4_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEM_OFF_1H & _IESO_OFF_1H
__CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L ; _VREGEN_OFF_2L
__CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_1_2H
__CONFIG _CONFIG3H, _MCLRE_ON_3H & _PBADEN_OFF_3H & _CCP2MX_OFF_3H
__CONFIG _CONFIG4L, _DEBUG_OFF_4L & _LVP_OFF_4L & _STVREN_OFF_4L & _XINST_OFF_4L
__CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L
__CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
__CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
__CONFIG _CONFIG6H, _WRTB_OFF_6H & _WRTC_OFF_6H & _WRTD_OFF_6H
__CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
__CONFIG _CONFIG7H, _EBTRB_OFF_7H
Colbhaidh said:Try the following.....
config FOSC = HSPLL_H ; HS with PLL enabled used by CPU and USB
config PLLDIV = 5 ; PLL prescaler 20/5=4 MHz (96MHz PLL needs
;4 MHz from prescaler)
config CPUDIV = OSC1_PLL2 ; PLL divided by 2 (96/2=48MHz) to feed CPU;
config USBDIV = 2 ; if full speed (FSEN=1) USB is fed by PLL
; divided by 2 (96/2=48MHz)
config IESO = OFF
config PWRT = OFF
config BOR = OFF
config BORV = 2.0
config VREGEN = ON
config WDT = OFF
config WDTPS = 32768
config MCLRE = ON
config LPT1OSC = OFF
config PBADEN = OFF
config CCP2MX = ON
config STVREN = ON
config LVP = OFF
config ICPRT = OFF
config XINST = OFF
config DEBUG = OFF
config CP0 = OFF
config CP1 = OFF
config CP2 = OFF
config CPB = OFF
config CPD = OFF
config WRT0 = OFF
config WRT1 = OFF
config WRT2 = OFF
config WRT3 = OFF
config WRTB = OFF
config WRTC = OFF
config WRTD = OFF
config EBTR0 = OFF
config EBTR1 = OFF
config EBTR2 = OFF
config EBTRB = OFF
CONFIG WDT=OFF ; disable watchdog timer
CONFIG MCLRE = ON ; MCLEAR Pin on
CONFIG DEBUG = ON ; Enable Debug Mode
CONFIG LVP = OFF ;Low-Voltage programming disabled (necessary for debugging)
CONFIG FOSC = HSPLL_HS ; HS oscillator, PLL enabled, HS used by USB
Why didn't my code work but Colbhaidh's work?
Did I miss some crucial CONFIG directives?
Any help will be appreciated.
and commented out the the line below :
config BORV = 2.0
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?