darrel taylor's instant interrupt compiler error


Closed Thread
Results 1 to 17 of 17
  1. #1

    Default darrel taylor's instant interrupt compiler error

    hello everyone!!

    i got the code of darrel taylor's instant interrupts and eagerly tried his program of toggling an led. but when i tried to compile it inside microcode studio using PIC16F84A as the target processor, i get an assembler error that says like this:

    Error[113]c:\progra~1\mecani~1\mcs\instan~1.asm 115:Symbol not previously defined (PIR1)

    When i compiled it with PIC16F628A,it was succesful but has no hex file generated. Do i need to comment out some lines in his DT_INTS-14.bas and ReEnterPBP.bas include files?

    any suggestions or comments is highly appreciated. Thank you very much!!

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


    Did you find this post helpful? Yes | No

    Default

    Are you using MPASM for the assembler?
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    The very first PIC with EEPROM memory was the 16C84.
    The 16F84 is simply the flash memory upgrade to a VERY OLD chip.

    I wish everyone would Stop using 16F84's!!!!!!
    They are worthless, and very expensive.<hr>As for the error ...

    You are probably trying to compile the example that uses Timer1 to blink an LED.
    But the 16F84A doesn't have a Timer1. Or a PIR1, or a USART, or an A/D module, or a ....

    You could try using Timer0.
    The "Combine" example has some Timer0 code.
    <br>
    DT

  4. #4


    Did you find this post helpful? Yes | No

    Default

    first of all thank you very much for the immediate reply..

    as for mackrackit: yes i am using MPASM as my assembler but why do i still get this same error?

    as for darrel taylor thank you for suggesting on not using 'F84s anymore but you see i don't have any available PICs beside the PIC16F84A and i haven't mastered yet PICBasic Pro language yet..
    Code:
    LED1   VAR  PORTB.1
    
    INCLUDE "DT_INTS-14.bas"     ' Base Interrupt System
    INCLUDE "ReEnterPBP.bas"     ' Include if using PBP interrupts
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler    INT_INT,  _ToggleLED1,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    
        INT_ENABLE   INT_INT     ; enable external (INT) interrupts
    ENDASM
    
    Main:
      PAUSE 1
    GOTO Main
    
    '---[INT - interrupt handler]---------------------------------------------------
    ToggleLED1:
         TOGGLE LED1
    @ INT_RETURN
    this is your example that i was trying to compile using microcode studio..
    pardon me for the inconvenience..

    i think that your code is the best way to service interrupts in picbasic environment which i can very much use for my led dot matrix(5x7) scrolling display..

    thank you very much!!

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


    Did you find this post helpful? Yes | No

    Default

    Add this line before the INT_LIST.
    Code:
    @PIR1 = EECON1
    DT

  6. #6


    Did you find this post helpful? Yes | No

    Thumbs up darrel taylor's instant interrupt compiler error

    a big thanks to you sir expert darrel taylor!!!

    it's already working!!

    thank you very much for the assistance!!

    by the way,is EECON1 a register in the PIC?

    thanks!!!

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    I wish everyone would Stop using 16F84's!!!!!!
    They are worthless, and very expensive.

    Hi Darrel, The thing is, Since it is so old and simple in terms of having very few enhancements, most of the PIC Basic books for beginners specify them, as the default configs set them up correctly, so the authors do not have to hassel explaining how to set config statements.
    Last edited by Archangel; - 13th December 2008 at 17:43.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  8. #8
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default I am anable to compile it

    Very likely I am missing somthing because I am unable to compile the DT_Ints-14 with 16F84A & 16F873 while 16F876 will compile with some warnings.

    Here the simple code:
    Code:
    LED1 VAR PORTB.1
    INCLUDE "DT_INTS-14.bas" ; Base Interrupt System
    INCLUDE "ReEnterPBP.bas" ; Include if using PBP interrupts
    
    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
    INT_Handler INT_INT, _ToggleLED1, PBP, yes
    endm
    INT_CREATE ; Creates the interrupt processor
    ENDASM
    @ INT_ENABLE INT_INT ; enable external (INT) interrupts
    Main:
    PAUSE 1
    GOTO Main
    '---[INT - interrupt handler]---------------------------------------------------
    ToggleLED1:
    TOGGLE LED1
    @ INT_RETURN
    These are the errors with 16F84A with "@PIR1 = EECON1" or w/o it (Flash 1024)
    ERROR: Variable wsave3 position request 416 beyond RAM_END 79.
    ERROR: Variable wsave2 position request 288 beyond RAM_END 79.
    ERROR: Variable wsave1 position request 160 beyond RAM_END 79.

    These are the erros with 16F873 & 16F874 (Flash 4096)
    ERROR: Variable wsave3 position request 416 beyond RAM_END 255.
    ERROR: Variable wsave2 position request 288 beyond RAM_END 255.

    These are the warnings with 16F876 (Flash 8192)
    Warning[205]c:\..................................\led_int.asm 495:Found directive in column 1. (endm)
    Warning[206]c:\..................................\led_int.asm 496:Found call to macro in column 1. (INT_CREATE)
    Warning[206]c:\..................................\led_int.asm 494:Found call to macro in column 1. (INT_Handler)
    I did not check if the above compilation was working or not ( the harware I had prepared was for 16F84A)
    The only explanation I am giving is the ram space, but since others have used with success the 16F84A with the same program, that means that the problem is with my compiler (ver 2.47) or something wrong I am doing.

    Any help will be greatly appreciated.

    Al.
    Last edited by aratti; - 14th December 2008 at 12:09.
    All progress began with an idea

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


    Did you find this post helpful? Yes | No

    Default

    For the wsave errors. Open the DT_INTS-14.bas file and at the top you'll see a section that says ...
    Code:
    ' --- IF any of these three lines cause an error ?? ----------------------------
    '       Comment them out to fix the problem ----
    ' -- It depends on which Chip you are using, as to which variables are needed --
    wsave1      var byte    $A0     SYSTEM      ' location for W if in bank1
    wsave2      var byte    $120    SYSTEM      ' location for W if in bank2
    wsave3      var byte    $1A0    SYSTEM      ' location for W if in bank3
    '-------------------------------------------------------------------------------
    For the "Found in column 1" warnings.
    You must maintain the proper indentation of the ASM blocks, as seen in the original examples.

    DT_INTS-14 (Hello World)
    http://www.darreltaylor.com/DT_INTS-14/hello.html
    DT

  10. #10
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Thank you Darel, for the prompt answer. Problem has been fixed.
    Now program compile (using @PIR1 = EECON1) correctly, and I can proceed experimenting with interrupts.

    Thank you again for your kindness. With the occasion, I whish you:

    Merry Christmas and Happy New Year

    Al.
    All progress began with an idea

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


    Did you find this post helpful? Yes | No

    Default

    Hi Al,

    You're welcome. And Happy Holiday's to you too.
    Whichever Holiday's they may be.

    Quote Originally Posted by delta_boogie View Post
    by the way,is EECON1 a register in the PIC?
    Yes, EECON1 is a register in the PIC.
    On the 16F84, it contains the EEIF bit (EEPROM Write Operation Interrupt Flag bit).
    On the other PIC16F's, that bit is located in either the PIR1 or PIR2 registers.

    The @PIR1 = EECON1 line tells the compiler to look at the EECON1 register for the EEIF bit, since there isn't a PIR1 or PIR2 in the 16F84.

    hth,
    DT

  12. #12


    Did you find this post helpful? Yes | No

    Default

    thanks a lot sir darrel!!

    merry christmas and advance happy new year!!!

    our preliminary examination for this semester is already through and now i can continue building my 1st time project(moving message display using 5x7 dot matrix) for a newbie like me..with your instant interrupt code i hopefully can utilize it effectively in my project...thanks a lot again!!i guess i have to read more the datasheet of PIC16F84A yahoooo!!!

  13. #13


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by delta_boogie View Post
    thanks a lot sir darrel!!

    merry christmas and advance happy new year!!!

    our preliminary examination for this semester is already through and now i can continue building my 1st time project(moving message display using 5x7 dot matrix) for a newbie like me..with your instant interrupt code i hopefully can utilize it effectively in my project...thanks a lot again!!i guess i have to read more the datasheet of PIC16F84A yahoooo!!!
    what happens to the compiler when you program something and ,say the processor is PIC16F628A, instead of compiling successfully it shows "cancelled" in the status bar..

  14. #14
    Join Date
    Oct 2009
    Location
    Austin, Texas
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Can I add my errors?

    I know this is an old thread, but I hope you don't mind me adding my error messages to the ones already corrected previously....I am using a PIC16F636. It has (1)8-bit timer, (1)16-bit timer. I have aready commented out errors wsave2 and wsave3.

    Why am I getting these errors?:
    Error TIMER~1.ASM 489 : [224]local drive only for use in macros
    Error TIMER~1.ASM 489 : [225]undefined symbol 'iflagreg'
    Error TIMER~1.ASM 489 : [226]numeric constant or symbol name expected
    Error TIMER~1.ASM 489 : [201]')' expected
    Error TIMER~1.ASM 489 : [235]opcode expected instead of 'error'
    Error TIMER~1.ASM 497 : [225]undefined symbol 'iflagreg'
    Error TIMER~1.ASM 497 : [300]too many errors

    I am trying to do a 20 minute and then a 50 minute event trigger using this process that you have show us. I really hope to get this working properly to salvage my project.

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


    Did you find this post helpful? Yes | No

    Default

    I don't mind.

    You need to use MPASM for the assembler.
    It won't work with the default PM.exe.

    hth,
    DT

  16. #16
    Join Date
    Oct 2009
    Location
    Austin, Texas
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    MPASM? I am a rookie and not familiar with this.....sorry. Is there more you can tell me or where to go for more? I am using PBP now, is this the problem?

    Thanks for the fast reply....I really appreciate your help.

    I just surfed my software settings and see where the ASSEMBER tab is located....it is in the "Compile and Program Options" pop-up. What should i do from there?

    Okay...I searched for the MPASM location automatically, and I now have compile without errors. Sorry for the learning curve Darrel, and thanks for the info.
    Last edited by ronbowalker; - 20th October 2009 at 18:52.

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


    Did you find this post helpful? Yes | No

    Default

    Which version of PBP do you have?

    If you have 2.60, then you can download the latest version of MPLAB (contains MPASM) from here ...

    http://www.microchip.com/stellent/id...&part=SW007002

    If you have an older version, then 8.15 is the last version that you can use.
    You can get 8.15a from melabs...

    http://www.melabs.com/support/mplab_old_versions.htm

    Then after you've installed it ...

    In MCS, go to the View | Compile and Program Options | Assembler Tab

    Click the Find Manually ... button and point it to
    C:\program files\microchip\mpasm suite

    Then check the Use MPASM checkbox.

    hth,<hr>
    Oops, you beat me to it.
    <br>
    Last edited by Darrel Taylor; - 20th October 2009 at 19:09. Reason: Bad timing :)
    DT

Similar Threads

  1. Optimizing DIV
    By skimask in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 22nd September 2008, 04:58
  2. Usart with Darrel Instant Interrupt
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th February 2008, 00:09
  3. using darrel taylor's instant interrupts
    By Michael Wakileh in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 31st July 2007, 04:07
  4. Ping Darrel Taylor - Timer0 Instant Interrupt
    By JEC in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th January 2007, 11:20
  5. Instant Interrupt Error
    By cool_justin in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th June 2006, 23:40

Members who have read this thread : 1

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