What does this line of assy code do in terms of HPWM in a 12F683?
@ DEVICE PIC12F683, FCMEN_OFF, IESO_OFF, INTRC_OSC_NOCLKOUT , WDT_OFF, PWRT_ON, MCLR_OFF, PROTECT_ON, BOD_OFF
It seems to be the cause of this error.
[ASM ERROR] 12F683 HPWM BUTTON.ASM (120) : Illegal opcode (PIC12F683)
[ASM WARNING] 12F683 HPWM BUTTON.ASM (120) : Found label after column 1. (DEVICE)
It's from some PBP code I snagged from the web. Here's the entire code.
Thanks for any help.
@ DEVICE PIC12F683, FCMEN_OFF, IESO_OFF, INTRC_OSC_NOCLKOUT , WDT_OFF, PWRT_ON, MCLR_OFF, PROTECT_ON, BOD_OFF
It seems to be the cause of this error.
[ASM ERROR] 12F683 HPWM BUTTON.ASM (120) : Illegal opcode (PIC12F683)
[ASM WARNING] 12F683 HPWM BUTTON.ASM (120) : Found label after column 1. (DEVICE)
It's from some PBP code I snagged from the web. Here's the entire code.
Rich (BB code):
@ DEVICE PIC12F683, FCMEN_OFF, IESO_OFF, INTRC_OSC_NOCLKOUT , WDT_OFF, PWRT_ON, MCLR_OFF, PROTECT_ON, BOD_OFF
OSCCON = %01110001 ' Internal 8MHz osc.
DEFINE OSC 8
' ======= Common Settings =================================
ADCON0 = 0
ANSEL = 0
CMCON0 = 7 ' Comparators off.
TRISIO = 0
GPIO = 0
' ============= PWM Settings =========
CCP1CON = %00001100 ' CCP1, PWM mode
PR2 = 250 '
T2CON = %00000101 ' TMR2 on, prescaler 1:4
CCPR1L = 0
Speed var CCPR1L
Btn Var GPIO.3 ' Assuming ; the pin is pulled down to GND by 10K resistor, and button pulls it high to Vdd.
' LED is connected to GPIO.2 (on board PWM module)
pause 10
Start:
if btn then
if speed + 85 < 256 then ' 0, 85, 170, 255, 0
speed = speed + 85
else
speed = 0
endif
while btn : pause 20 : wend
endif
pause 2
goto Start
end