It's trying to compile both your source file and the include file separately.
Remove DT_INTS-14.bas from the "Source Files".
You should only have your main program in the source files list of MPLAB.
It's trying to compile both your source file and the include file separately.
Remove DT_INTS-14.bas from the "Source Files".
You should only have your main program in the source files list of MPLAB.
DT
Thanks Darrel - that did the trick.
Now that I have the simple things sorted it is onwards and upwards to bigger and better phases of my project.
Cheers
Barry
OK, I have now tried to implement the DT_INST-14 routines into my main project code. The attached code file has sufficient comments to explain what it is doing.
I am getting the following errors when I try to compile the program:
Executing: "C:\PBP\PBPMPLAB.BAT" -ampasmwin -k- -p12F683 "PICSprayer.bas"
Executing: "C:\PBP\PBPW.EXE" -ampasmwin -k- -p12F683 "PICSprayer.bas"
PICBASIC PRO(TM) Compiler 2.60C, (c) 1998, 2011 microEngineering Labs, Inc.
All Rights Reserved.
ERROR: Unable to execute mpasmwin.Error[127] C:\PBP\PROJECTS\PIC SPRAYER\PICSPRAYER.ASM 912 : Too many arguments
Error[128] C:\PBP\PROJECTS\PIC SPRAYER\PICSPRAYER.ASM 473 : Missing argument(s)
Halting build on first failure as requested.
BUILD FAILED: Fri Jul 08 11:35:51 2011
My code compiles properly without the interrupt routine for the manual switch operation. Now I just don't know where to start looking to fix these errors.
Any help would be greatly appreciated.
Cheers
Barry
PICSprayer.bas
PICSPRAYER_r6.pdf
Please post your code using code tags.
Dave
Always wear safety glasses while programming.
You don't need to place these in your code;
Just uncomment them in your DT_INTS-14.bas file.Code:wsave VAR BYTE $20 SYSTEM wsave1 VAR BYTE $A0 SYSTEM
For assembly you need to use the ; for comments. INT_LIST macro should look like this;
Code:INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler INT_INT, _ManualSwitch, PBP, yes endm INT_CREATE ; Creates the Interrupt Processor ENDASM @ INT_ENABLE INT_INT ; Enable external (INT) interrupts
Please replace your interrupt routine by code by this one, and post your results;
Code:ASM INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler INT_INT, _ManualSwitch, PBP, yes endm INT_CREATE ; Creates the interrupt processor INT_ENABLE INT_INT ; Enable ENDASM
EDIT: Bruce was faster than me...
Last edited by gadelhas; - 8th July 2011 at 11:34. Reason: Bruce was faster
Thanks and Regards;
Gadelhas
Thanks Bruce and Gadelhas.
I have made the recommended changes and am pleased to advise that it now compiles correctly.
Now to fire it up on the breadboard to see if it works as expected.
Dave, I do no understand your comment regarding the use of code tags. Can you explain further or direct me to somewhere that will outline what I am not doing?
Cheers
Barry
Hi All,
I am pleased to announce that the external interrupt routine is now working properly. Thank you to all who have helped me resolve my problems - much appreciated
To aid in my PCB layout I would like to move my ADC channels to AN1 and AN2. This will mean that I need to alter the type of interrupt from an external interrupt on GP2 to a Change on Interrupt on GP4. To do this I have changed the Interrupt Handler in DT_INST-14 from INT_INT to GPC_INT, Enable GPC_INT and enabled bit 4 of the Interrupt-On-Change GPIO Register (ie IOC.4=1). My interrupt switch is set up with a 10k pull-up resistor from GP4 to +5V and a momentary action switch from GP4 to 0V. The code compiles without error but the change on interrupt function does not work in "the real world".
I would have thought this was a pretty straight forward change but I am obviously missing something important. Would someone please direct me to where I have gone wrong?
Cheers
Barry
Hi Barry,
In your latest attached code you have the lineWhich sets GPIO.4/AN3 to analog mode. Try changing it to digital if you haven't already done that.Code:ANSEL = %01011010 ' Set Fosc/16
Bookmarks