also is it
_CONFIG or __CONFIG.
also
trying to place config on two lines that way will lead to overwrite error/warning
at least in pbp3 not sure about dinosaur versions
also is it
_CONFIG or __CONFIG.
also
trying to place config on two lines that way will lead to overwrite error/warning
at least in pbp3 not sure about dinosaur versions
Warning I'm not a teacher
thanks for responding. So I tried all above suggestions with no luck.
IF (CODE ON ONE LINE)
THEN iLLEGAL OPCODE (_HS_OSC) Character after Config illegalCode:asm _CONFIG _HS_OSC & _MCLRE_OFF & _WDT_OFF & _PWRTE_OFF & _CPD_OFF & _BOD_ON & _IESO_OFF & _FCMEN_OFF endasm
IF
THEN ILLEGAL CHARACTER (,) Character after Config illegal, with or without space after (,)Code:asm _CONFIG, _HS_OSC & _MCLRE_OFF & _WDT_OFF & _PWRTE_OFF & _CPD_OFF & _BOD_ON & _IESO_OFF & _FCMEN_OFF endasm
IF
THEN ILLEGAL CHARACTER (,)Code:@_CONFIG, _HS_OSC & _MCLRE_OFF & _WDT_OFF & _PWRTE_OFF & _CPD_OFF & _BOD_ON & _IESO_OFF & _FCMEN_OFF
IF space after @ then Illegal opcode (_CONFIG)
If i turn off MPASM assembler it WILL assemble OK. looks like interrupts will have to be in ASM is I can't get this worked out. Oh well, I need the practice.
Why are you putting the pic config stuff in the assembler code sections?
Here is one of my 12F683 configs..
It should be right at the start of the program.
Code:#config __config _FCMEN_ON & _IESO_ON & _BOD_OFF & _CPD_OFF & _CP_OFF & _MCLRE_OFF & _PWRTE_OFF & _WDT_OFF & _INTOSCIO #ENDCONFIG DEFINE OSC 8 'Set PicBasic Pro processor speed to 8 Mhz (Must match oscillator value) INTCON = %10001000 'Internal oscillator OSCCON = %01110101 'Sets internal osc to 8 Mhz (Default) and stable CMCON0 = %00000111 'Comparators off TRISIO = %00101011 'Set Pins GPIO.0, GPIO.1 GPIO.3 & GPIO.5 as inputs ANSEL = %00000000 'No Analog Inputs OPTION_REG = %01111111 'Global Enable Weak Pull Ups WPU = %00000011 'Weak Pull Ups Enabled on GPIO.0 & 1
I had to once, find the '683' INC or MAC file referred to by the assembler, look at the way the configs are expected in those files. I had to change my code to match the referenced/expected format/characters
I've never seen it done like that before and I also use DT stuff and 16f83...
Plus to the above, you still had one underscore instead of the correct two.
Ioannis
I have used the following header for the 12F683 many times and never encountered any compiling problems. Try it.
CMCON0 = 7 'comparators off
ANSEL = 0 'all inputs digital, the adcin command automatically converts it to analog
DEFINE OSCCON_1K 1 ' Set OSCCAL for 1K device to accurize osc
OSCCON = %01110111 'Set osc to 8MHZ 12F683. Normally I leave this line out to default to 4MHZ
@ DEVICE MCLR_ON, INTRC_OSC_NOCLKOUT, WDT_ON, BOD_OFF, PWRT_ON, PROTECT_ON
START:
Bookmarks