DT inst. interrupt & Timer0 with pic 16F88


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2008
    Location
    Italy
    Posts
    825

    Default DT inst. interrupt & Timer0 with pic 16F88

    I am anable to compile without ERROR[113] Symbol not previously defined (T0IF) using timer0 interrupt.

    Here the code:

    Code:
    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    RX_INT,   _Getbytes,     PBP,  yes          
            INT_Handler    TMR0_INT, _TM0Label,     PBP,  yes  
            ;INT_Handler    TMR1_INT, _TM1Label,     PBP,  yes
                 
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    
    @     INT_ENABLE  RX_INT     ; enable RX_INT interrupts
    @     INT_ENABLE TMR0_INT
    ;@     INT_ENABLE TMR1_INT
    
    .
    .
    .
    .
    If I comment out TMR0 interrupt then the code compiles correctly, this is the case also with TMR1 interrupt (good compiling) but not with TMR0.

    Since, I cannot find out the reason for this error, I need help please.


    Al.
    All progress began with an idea

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


    Did you find this post helpful? Yes | No

    Default

    Open P16F88.INC in your MPLAB directory and look under the INTCON Bits section.

    Code:
    ;----- INTCON Bits --------------------------------------------------------
    GIE                          EQU     H'0007'
    PEIE                         EQU     H'0006'
    TMR0IE                       EQU     H'0005'
    INTE                         EQU     H'0004'
    RBIE                         EQU     H'0003'
    TMR0IF                       EQU     H'0002'
    INTF                         EQU     H'0001'
    RBIF                         EQU     H'0000'
    It's defined as TMR0IF. You can fix this with;
    Code:
    ;----- INTCON Bits --------------------------------------------------------
    GIE                          EQU     H'0007'
    PEIE                         EQU     H'0006'
    TMR0IE                       EQU     H'0005'
    INTE                         EQU     H'0004'
    RBIE                         EQU     H'0003'
    TMR0IF                       EQU     H'0002'
    T0IF                         EQU     H'0002'
    INTF                         EQU     H'0001'
    RBIF                         EQU     H'0000'
    Several of the newer 16F header files have it listed both ways.
    Regards,

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

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


    Did you find this post helpful? Yes | No

    Default

    Thank you Bruce, very kind of you. Simple thing if you know it!

    Al.
    All progress began with an idea

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


    Did you find this post helpful? Yes | No

    Default No success

    Now my pic16F88.inc INTCON Bits section is as below, but not success in compiling. Still the same error# but changed definition. Now: "Symbol not priously defined (T0IE)"


    Code:
    ;----- INTCON Bits --------------------------------------------------------
    GIE                          EQU     H'0007'
    PEIE                         EQU     H'0006'
    TMR0IE                       EQU     H'0005'
    INTE                         EQU     H'0004'
    RBIE                         EQU     H'0003'
    TMR0IF                       EQU     H'0002'
    T0IF                         EQU     H'0002'
    INTF                         EQU     H'0001'
    RBIF                         EQU     H'0000'
    Still, commenting out TMR0_INT error disappear.

    Al.
    Last edited by aratti; - 24th October 2009 at 16:40.
    All progress began with an idea

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


    Did you find this post helpful? Yes | No

    Default

    Just add it & save it.
    Code:
    ;----- INTCON Bits --------------------------------------------------------
    
    GIE                          EQU     H'0007'
    PEIE                         EQU     H'0006'
    T0IE                         EQU     H'0005' ; <---- same as below without the MR
    TMR0IE                       EQU     H'0005'
    INTE                         EQU     H'0004'
    RBIE                         EQU     H'0003'
    T0IF                         EQU     H'0002'
    TMR0IF                       EQU     H'0002'
    INTF                         EQU     H'0001'
    RBIF                         EQU     H'0000'
    Regards,

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

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


    Did you find this post helpful? Yes | No

    Default Problem fixed!

    Thank you again Bruce, this additional line fixed the problem!

    Al.
    All progress began with an idea

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


    Did you find this post helpful? Yes | No

    Default

    Sorry for the late entry, but I have the same issue and I am not familiar with where the .inc file you guys are editing is located. Can you assist me?

    I scanned my PC and found it. Made the change as recommended above, all errors were fixed. Thanks guys...
    Last edited by ronbowalker; - 17th December 2009 at 21:33. Reason: Updated info...

Similar Threads

  1. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  2. Sleep Mode
    By Pesticida in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th March 2008, 10:31
  3. Ping Darrel Taylor - Timer0 Instant Interrupt
    By JEC in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th January 2007, 11:20
  4. Replies: 1
    Last Post: - 2nd November 2006, 23:24
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

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