Question on DT_Interrupts


Closed Thread
Results 1 to 4 of 4

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    You have Timer1 configured to operate from the T1G gate input pin.

    This works fine on the 690;
    Code:
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
             INT_Handler   TMR1_INT,     _CHECK,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
       T1CON = %00110001
     
    @ INT_ENABLE  TMR1_INT
     
      while 1
          FOR W1=1 TO 10
          TOGGLE PORTB.5
          PAUSE 100
        NEXT W1
     
        FOR W1=1 TO 5
          TOGGLE PORTB.5
          PAUSE 1000
        NEXT W1
      wend
     
    CHECK:
        TOGGLE PORTB.6
    @ INT_RETURN
    Regards,

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

  2. #2


    Did you find this post helpful? Yes | No

    Question

    I will try it on 690 soon. Please answer on 16F676 as well.
    Here is my code for 676:

    Code:
    Include "modedefs.bas"
    INCLUDE "DT_INTS-14.bas"
    INCLUDE "ReEnterPBP.bas"
    DEFINE OCS 4
    DEFINE OSC_1K 1
    
    @ __Config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN & _CP & _CPD
    
    PAUSE 50
    TRISA = %001000
    TRISC = 0
    PORTC = 0
    PORTA = 0
    CMCON = 7
    ANSEL = 0
    OPTION_REG=128
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR1_INT,  	  _CHECK,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    T1CON=%00010001
    @ INT_ENABLE TMR1_INT
    
    while 1
        FOR code=1 TO 5
          TOGGLE pin8
          PAUSE 1000
        NEXT code
      wend
    
    CHECK:
    toggle pin7
    i=i+1
    if i=2 then
    Portc=%000000
    PORTC=0
    i=0
    endif
    @ INT_RETURN
    The led on Pin7 (in ISR) seems to be blinking at a constant rate BUT pin8 is erratic. Do I need to take care of any other setting as well? Thanks
    ___________________
    WHY things get boring when they work just fine?

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


    Did you find this post helpful? Yes | No

    Default

    What is this? DEFINE OSC_1K 1

    If you're trying to load the factory osccal value use DEFINE OSCCAL_1K 1.

    Which physical pin is pin8 & where have you defined pin8?

    If it's on PORTC, you're clearing this in your int handler (twice).
    Regards,

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

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