Quote Originally Posted by Acetronics View Post
Could you try those lines ???

Code:
 
 
@ Errorlevel -306
 
'-----------------------
' PIC Defines
' ===========
 'Config bits 
 
@    __CONFIG  _CONFIG1H, _IESO_OFF_1H & _FSCM_OFF_1H & _INTIO2_OSC_1H
@    __CONFIG  _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_27_2L
@    __CONFIG  _CONFIG2H, _WDT_ON_2H & _WDTPS_32K_2H
@    __CONFIG  _CONFIG3H, _MCLRE_OFF_3H
@    __CONFIG  _CONFIG4L, _DEBUG_OFF_4L & _LVP_OFF_4L & _STVR_OFF_4L
@    __CONFIG  _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L
@    __CONFIG  _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
@    __CONFIG  _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L
@    __CONFIG  _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
@    __CONFIG  _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L
@    __CONFIG  _CONFIG7H, _EBTRB_OFF_7H    
 
'    Include "modedefs.bas"          ' Include serial modes
'   DEFINE OSC 8 '8Mhz clock used. Note - Set PIC config fuses on programmer to use Internal RC OSC
' Define some constants if needed
 
 ....
....
 
 
' Initialise Processor - check for each PIC type 
' --------------------
    ADCON1 = %11111111              'Turn off all AD's     
    OSCCON =  %01100111     'set INTRC to 4 MHZ    <<<  I Think the error was here : define directly bits without ANY ORing ...
'    OSCCON = %01110111     'set INTRC to 8 MHZ
'    OSCTUNE = 0                      'OSC trim set to Null
and comment your configs ... ( I cut and pasted from an old 1320 program of mine ... as you see I never believe in defaults !!! )

your OSCCON settings ... mmmhhhh, how to say, ... I do not like them !!!!

Alain
OK, we have success.

Your @ _Config text compiles with no errors. I also confirmed that my code slowed down as expected if there was a mismatch of DEFINE and OSC settings... All good.

Your OSCCON works too, but so does mine. Interesting, I read in another forum that the OR'd method was good because it allowed the other bits to not be altered. Maybe I misinterpreted when or why this was good.

So, anybody understand why the preferred Microchip config method gave me an error ?