PDA

View Full Version : Configuration bits



Perrin`
- 26th June 2008, 16:32
Ninja Edit here: I solved the problem so dont waste your time unless you're just curious.

I've been using the internal oscillator a bit on a PIC18F2520. I just defined OSCCON and away I went. It is defaulting to INTIO with port function on pins OSC1/RA7 and OSC2/RA6. I now want to specify the bits in CONFIG1H to have clockout on RA6. So I've been looking around and I found 2 threads(linked below). At the very minimum i've cut down to this(and of course... not understanding why its not working):


asm
CONFIG OSCS=OFF,OSC=INTIO7
endasm


So when I try this I get this error:
Error[177] __CONFIG directives cannot be used with CONFIG directives


So I tried adding __(which of course was wrong). I then tried defining the old way.



asm
__CONFIG _CONFIG1H, _OSC_INTIO7_1H
endasm


Which of course gave me:
Error[118] C:\IDE PROGRAMS\SERIAL\SERIAL.ASM 339 : Overwriting previous address contents (0000)
Error[118] C:\IDE PROGRAMS\SERIAL\SERIAL.ASM 339 : Overwriting previous address contents (0001)

http://www.picbasic.co.uk/forum/showthread.php?t=543

http://www.picbasic.co.uk/forum/showthread.php?p=13087

This is taken from my .inc file in the MPASM directory.


;
; 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 bits:
; OSC = LP LP oscillator
; OSC = XT XT oscillator
; OSC = HS HS oscillator
; OSC = RC External RC oscillator, CLKO function on RA6
; OSC = EC EC oscillator, CLKO function on RA6
; OSC = ECIO6 EC oscillator, port function on RA6
; OSC = HSPLL HS oscillator, PLL enabled (Clock Frequency = 4 x FOSC1)
; OSC = RCIO6 External RC oscillator, port function on RA6
; OSC = INTIO67 Internal oscillator block, port function on RA6 and RA7
; OSC = INTIO7 Internal oscillator block, CLKO function on RA6, port function on RA7


Whats wrong?

-- I needed to comment out the lines(as seen below) in the .INC file in the PBP directory.


;__CONFIG _CONFIG1H, _OSC_INTIO7_1H
;__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
;__CONFIG _CONFIG3H, _PBADEN_OFF_3H
;__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L

Perrin`
- 26th June 2008, 16:39
Somehow I knew... as soon as I posted... I'd figure it out, problem solved

skimask
- 26th June 2008, 17:35
Don't get on yourself too hard...

Somehow I knew... as soon as I posted... I'd figure it out, problem solved
That's exactly the sort of thing some of us around here like to see

iw2fvo
- 28th June 2008, 14:36
Hi, I have the same problem using Mpasm: how did you solve them ?
Thanks
Ambro
Iw2fvo



Somehow I knew... as soon as I posted... I'd figure it out, problem solved

Perrin`
- 3rd July 2008, 14:40
Whats wrong?

-- I needed to comment out the lines(as seen below) in the .INC file in the PBP directory.


;__CONFIG _CONFIG1H, _OSC_INTIO7_1H
;__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
;__CONFIG _CONFIG3H, _PBADEN_OFF_3H
;__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L


Sorry this is kinda late I was on vacation XD