PDA

View Full Version : 18f4525 Config



Firegod
- 27th February 2007, 04:48
Of course a new guy once again with a goofy question.

I have been trying to use the CONFIG directive with PBP but I can't seem to get it to compile as in all the examples I have seen.

I have tried:
@ CONFIG OSC=ECIO6
config OSC=ECIO6
@__config OSC=ECIO6
@config OSC=ECIO6

And they all come up with errors.

But this works:
@__config_OSC_ECIO6_1H

but I am unable to put an "&" on the end to add additional directives.

Also how do I configure the directive:
WDT = ON

I found this in the MPASM 18F4525.INC file:

; IMPORTANT: For the PIC18 devices, the __CONFIG directive has been
; superseded by the CONFIG directive. The following settings
; are available for this device.
;
; Oscillator Selection:
; OSC = LP LP
; OSC = XT XT
; OSC = HS HS
; OSC = RC RC
; OSC = EC EC-OSC2 as Clock Out
; OSC = ECIO6 EC-OSC2 as RA6
; OSC = HSPLL HS-PLL Enabled
; OSC = RCIO6 RC-OSC2 as RA6
; OSC = INTIO67 INTRC-OSC2 as RA6, OSC1 as RA7
; OSC = INTIO7 INTRC-OSC2 as Clock Out, OSC1 as RA7
;
; Fail Safe Clock Monitor:
; FCMEN = OFF Disabled
; FCMEN = ON Enabled
;
; Internal External Osc. Switch Over:
; IESO = OFF Disabled
; IESO = ON Enabled
;
; Power Up Timer:
; PWRT = ON Enabled
; PWRT = OFF Disabled
;
; Brown Out Reset:
; BOREN = OFF Disabled
; BOREN = ON Enabled
; BOREN = NOSLP Enabled except SLEEP, SBOREN Disabled
; BOREN = SBORDIS Enabled, SBOREN Disabled
;
; Brown Out Voltage:
; BORV = 45 4.5V
; BORV = 42 4.2V
; BORV = 27 2.7V
; BORV = 25 2.5V
;
; Watchdog Timer:
; WDT = OFF Disabled
; WDT = ON Enabled


Any help would be nice for yet another newbie.

Archangel
- 27th February 2007, 05:03
The register data indicates WDTCON, BOD,. . . registers. Looks like you have to do table write as detailed in section 23.1 of the data sheet, which sends you back to section 6.5 to see how to flash the internal memory , Definatly Clear as Mud. I would try accessiing through the registers, something like WDTCON = %00000001 'wdt on OR WDTCON=%00000000 ' WDt off.
Now I am about as sure of this as I am of having all 6 numbers in the lottery, but unlike the lottery this cost nothing but some time to try.
JS

Firegod
- 27th February 2007, 09:44
This is what was doing to get around the @__config statement:

WDTCON.0=1
OSCCON.0=0
OSCCON.1=0
TRISA.6 = 0

Is this the correct way to configure the oscillator mode to ECIO (External Clock with I/O on RA6)?