PDA

View Full Version : Compile "opcode"



mbw123
- 23rd September 2006, 14:38
I tried compiling the code below for a PIC16F628A and I got and error stating:
" opcode expected instead of '__config' ". Please help...

-Mike

CODE:

@ __CONFIG _INTRC_OSC_NOCLKOUT & _MCLRE_ON & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON

TRISB = %11101011
CMCON = 7
Baud con 16780 ' 2400 bauds
Pre CON $A5
Synch CON "~"
In var byte

LOW PORTB.2 ' inverted mode normal idle state
pause 50

Main:
if (PORTB.1 = 0) then pressed
goto main

Pressed:
serout2 PORTB.2, baud, [Pre, Synch,"1"]
serin2 PORTB.3, baud, [WAIT(Synch),in]
if (in == "1") then
high PORTB.4
pause 250
low PORTB.4
pause 250
endif
goto main

sayzer
- 23rd September 2006, 16:06
Change:

@ __CONFIG _INTRC_OSC_NOCLKOUT & _MCLRE_ON & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON

to:

@ DEVICE INTRC_OSC_NOCLKOUT & MCLR_ON & LVP_OFF & WDT_OFF & PWRT_ON & BOD_ON