My DT_Interrupts broke in PBP3... guess I'm too dense too figure out why


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323

    Default My DT_Interrupts broke in PBP3... guess I'm too dense too figure out why

    Well, now that I've switched from PBP2..6 to PBP3 I seem to be having trouble with DT_Interrupts in some "previously working" code.

    I've read the manual about migrating from PBP2.6 to 3.0, and have successfully applied it to other programs, but can't seem to get it going on this one.

    The chip is a 16F726. It uses DT_interrupts in a touch sensor routine.
    The code worked when compiled with PBP2.6 but creates some "ASM Errors" with PBP3

    Here's the errors I get:
    Name:  errors.gif
Views: 610
Size:  11.4 KB


    Here's my ASM code. First, some config stuff.
    Used to be:
    Code:
    @  __config _CONFIG1, _DEBUG_OFF & _PLL_EN & _BORV_2_5 & _BOR_ON & _CP_OFF & _MCLRE_OFF & _PWRT_EN & _WDT_OFF & _INTOSCIO
    @  __config _CONFIG2, _VCAP_RA0
    Now looks like:
    Code:
    #CONFIG
        __config _CONFIG1, _DEBUG_OFF & _PLL_EN & _BORV_2_5 & _BOR_ON & _CP_OFF & _MCLRE_OFF & _PWRT_EN & _WDT_OFF & _INTOSCIO
        __config _CONFIG2, _VCAP_RA0
    #endCONFIG

    Then I set up the interrupt. Here's my OLD code for PBP2.6:
    Code:
    '-----Set up Interrrupts
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR1GATE_INT,  _CheckCount,   PBP,  yes
         endm    
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    @ INT_ENABLE  TMR1GATE_INT     ; enable Timer 2 interrupts

    And the NEW code for PBP3:
    Code:
    '-----Set up Interrrupts
    #CONFIG
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
    INT_Handler   TMR1GATE_INT,  _CheckCount,   PBP,  yes
        endm    
    INT_CREATE               ; Creates the interrupt processor
    #ENDCONFIG
    
    #CONFIG
    INT_ENABLE  TMR1GATE_INT     ; enable Timer 1 interrupts
    #ENDCONFIG
    At the end of my interrupt handler routine I had this:
    Code:
    @ INT_RETURN
    Which has been changed to this:
    Code:
    #CONFIG
    INT_RETURN
    #ENDCONFIG

    That'all the ASM there is.

    I clearly haven't done it right... could someone point me in the right direction?

    Thanks!

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


    Did you find this post helpful? Yes | No

    Default Re: My DT_Interrupts broke in PBP3... guess I'm too dense too figure out why

    DT_INTS in not part of the device configuration.
    Don't put #CONFIG/#ENDCONFIG around them. Put it back to ASM/ENDASM.

    And watch the indentation. ASM is sensitive to that.
    DT

  3. #3
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default Re: My DT_Interrupts broke in PBP3... guess I'm too dense too figure out why

    Thanks Darrel!
    I knew I'd done something stupid and that was it!

    Welll... part of it.
    It did indeed get rid of those errors, but it brought up some fresh ones.

    Name:  errors-2.gif
Views: 531
Size:  10.6 KB

    I'm clearly still not getting it right. (I seem to have lost the "embarrassed" smilie, but consider it Inserted Here.)

    Here's the code again:
    Code:
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR1GATE_INT,  _CheckCount,   PBP,  yes
         endm    
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    @ INT_ENABLE  TMR1GE     ; enable Timer 2 interrupts
    Thanks much

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


    Did you find this post helpful? Yes | No

    Default

    @ INT_ENABLE TMR1GATE_INT ; enable Timer 1 gate interrupts
    DT

  5. #5
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default Re: My DT_Interrupts broke in PBP3... guess I'm too dense too figure out why

    I'm sorry Darrel, I'm getting to where I can't even cut & paste the right code anymore.
    I think I need to step away from the keyboard and go make some cookies or something instead.

    THIS gives the errors shown in my last post.


    Code:
    '-----Set up Interrrupts
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR1GATE_INT,  _CheckCount,   PBP,  yes
         endm    
        INT_CREATE               ; Creates the interrupt process
    ENDASM
    
    @ INT_ENABLE  TMR1GATE_INT     ; enable Timer 1 interrupts

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


    Did you find this post helpful? Yes | No

    Default Re: My DT_Interrupts broke in PBP3... guess I'm too dense too figure out why

    Sorry, since you said the 2.60 code worked, I just copied from that post.

    But actually, it's ... T1GATE_INT
    DT

  7. #7
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default Re: My DT_Interrupts broke in PBP3... guess I'm too dense too figure out why

    Hi Darrel,

    Thanks for your help. I'm sorry I haven't followed through with this yet.

    I discovered wet carpet in a spare bedroom and traced it back to a leak in the bathroom.
    Rotten floor, ruined carpet, damaged wall, the whole works.
    Major repairs underway and I don't know when I'll have time for PIC games again...

    But I *really* appreciate all your help and I hope you and your family are having the best thanksgiving ever this year!



    Steve

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