DT Instant Interrupts - Clarification?


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    Thanks Dave.

    I have added the two variables wsave and wsave1 as specified in DT_INST-14.bas
    I now have more errors at compilation:

    Executing: "C:\PBP\PBPMPLAB.BAT" -ampasmwin -k# -p12F683 "DT_INTS-14 Test.bas"
    Executing: "C:\PBP\PBPW.EXE" -ampasmwin -k# -p12F683 "DT_INTS-14 Test.bas"
    PICBASIC PRO(TM) Compiler 2.60C, (c) 1998, 2011 microEngineering Labs, Inc.
    All Rights Reserved.
    Executing: "C:\PBP\PBPMPLAB.BAT" -ampasmwin -k# -p12F683 "DT_INTS-14.bas"
    Executing: "C:\PBP\PBPW.EXE" -ampasmwin -k# -p12F683 "DT_INTS-14.bas"
    PICBASIC PRO(TM) Compiler 2.60C, (c) 1998, 2011 microEngineering Labs, Inc.
    All Rights Reserved.
    ERROR: Unable to execute mpasmwin.Error[113] C:\PBP\PBPPIC14.LIB 1165 : Symbol not previously defined (INT_ENTRY)
    Error[101] C:\PBP\PROJECTS\DT_INTS-14 TEST\DT_INTS-14.ASM 187 : ERROR: (wsave variable not found,)
    Error[101] C:\PBP\PROJECTS\DT_INTS-14 TEST\DT_INTS-14.ASM 153 : ERROR: (" Add:" wsave VAR BYTE $20 SYSTEM)
    Error[101] C:\PBP\PROJECTS\DT_INTS-14 TEST\DT_INTS-14.ASM 208 : ERROR: (Chip has RAM in BANK1, but wsave1 was not found.)
    Error[101] C:\PBP\PROJECTS\DT_INTS-14 TEST\DT_INTS-14.ASM 160 : ERROR: (" Add:" wsave1 VAR BYTE $A0 SYSTEM)
    Halting build on first failure as requested.

    Any clues here?

    Again, I have attached a copy of my main code for review.

    Cheers
    Barry
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    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

  3. #3
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    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

  4. #4
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    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

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    Please post your code using code tags.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    You don't need to place these in your code;
    Code:
    wsave VAR BYTE $20 SYSTEM
    wsave1 VAR BYTE $A0 SYSTEM
    Just uncomment them in your DT_INTS-14.bas file.

    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
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  7. #7
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    Quote Originally Posted by Aussie Barry View Post
    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
    Attachment 5752
    Attachment 5751
    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

  8. #8
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    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

  9. #9
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    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

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts