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):
So when I try this I get this error:Code:asm CONFIG OSCS=OFF,OSC=INTIO7 endasm
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.
Which of course gave me:Code:asm __CONFIG _CONFIG1H, _OSC_INTIO7_1H endasm
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.
Whats wrong?Code:; ; 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
-- I needed to comment out the lines(as seen below) in the .INC file in the PBP directory.
Code:;__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





Bookmarks