I'm new to PIC programming and trying to work through book examples. Working on Example7 (appendix B Examples)Using macros and debounce routine. I get a Error (Error[113] C:\DOCUMENTS AND SETTINGS\HP_ADMINISTRATOR\MY DOCUMENTS\PROGRAMMING\PIC\MICROCHIP\44-PIN DEMO BOARD\SAMPLE\BUTTON.INC 15 : Symbol not previously defined (PORT)) when trying to build.
I have looked this up and read and find no answer so could someone please help. Thank you
I'm using MPLAB IDE v8.60 and PIC 2 Kit with 16F887
The error is in the macro button.asm Below is the code. When I click on error it goes to the first btfsc. Thank you
Here is the site for examples working on #7
http://www.mikroe.com/eng/chapters/view/12/appendix-b-examples/
I have looked this up and read and find no answer so could someone please help. Thank you
I'm using MPLAB IDE v8.60 and PIC 2 Kit with 16F887
The error is in the macro button.asm Below is the code. When I click on error it goes to the first btfsc. Thank you
Here is the site for examples working on #7
http://www.mikroe.com/eng/chapters/view/12/appendix-b-examples/
Rich (BB code):
*************************************************************************
*************************************************************************
button MACRO port,pin,hilo,label;
local Pressed1 ; All labels are local
local Pressed2
local Exit1
local Exit2
IFNDEF debouncedelay ; Enables debounce time to be defined
; in main program
#define debouncedelay .10
ENDIF
IF (hilo == 0) ; If pull-up used
btfsc port, pin ; If "1", push-button is pressed
goto Exit1
pausems debouncedelay ; Wait for 10ms debounce
Pressed1
btfss port, pin
goto Pressed1
pausems debouncedelay ; Wait until released and
goto label ; jump to specified address
Exit1
ELSE ; If pull-down used
btfss port, pin
goto Exit2 ; If "0", push-button is released
pausems debouncedelay ; Wait for 10ms debounce
Pressed2
btfsc port, pin
goto Pressed2
pausems debouncedelay ; Wait until released and
goto label ; jump to specified address
Exit2
ENDIF
ENDM
Last edited by a moderator: