Canīt get DTīs interrupts working


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Mugelpower View Post
    now I get those errors:
    Error C: \pbp\pbppic14.lib 1160 : [225]undefined symbol 'INT_ENTRY'
    Error C: \pbp\pbppic14.lib 1162 : [225]undefined symbol 'INT_ENTRY'
    Error : [212] extra tokens on end of line
    I get your errors if I do this:
    Code:
    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
        INT_Handler TMR1_INT, _ClockCount, PBP, yes
        endm
        ;INT_CREATE ; Creates the interrupt processor
    
        INT_ENABLE TMR1_INT ; Enable Timer 1 Interrupts
    ENDASM

  2. #2
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    116


    Did you find this post helpful? Yes | No

    Red face got a supersimple DT Timer working

    Hi Guys & Dolls,

    got the DT program running but needed to implement a stupid LCD comment first!

    otherwise the lcd shows only rubbish
    Code:
    '****************************************************************                                            *
    '*  Notes   : To use this example with MicroCode Studio, you    *
    '*          : should:                                           *
    '*          : PIC 16F88 4 MHZ crystal                           *
    '*                   WORKS!                  ī                  *
    '****************************************************************
    
    
    
    
    
        CMCON = 7         ' Disable analog comparator
        ANSEL = %00000000     ' set all to digital
              
    Include "modedefs.bas"
    
    
    define OSC 4            ' this example uses a 4MHz clock
    
            CMCON = 7                ' RA0-RA3 are digital I/O
            TRISA = 0                ' PORT A is output
             TRISB = 3       ' RB0 is Input count RB1 Input reset others output
          
    
    Minute   var     byte    ' Define minute variable
    Second   var     byte    ' Define second variable
    Ticks    var     byte    ' Define pieces of seconds variable
    DoUpdate var     byte    ' Define variable to indicate update 
    
    clear             ' clear all RAM (sets all VAR declarations to zero)
    DoUpdate = 1      ' Force first display
    
    OPTION_REG = %00000101            ' Set TMR0 configuration 
    INTCON = $A0                ' Enable TMR0 interrupts
    On Interrupt Goto TickInterrupt
       
             PAUSE 100
            LCDOUT $FE,1,"Guten" 
            pause 2000
             LCDOUT $FE,1,"Tag" 
            pause 2000
            
    ' Main program loop 
    MainLoop:
       if DoUpdate then
          LCDOUT $FE,1
           LCDOUT $FE,1,DEC2 Minute, ":",DEC2 Second  
           DoUpdate = 0
       endif
       Goto MainLoop  
    
    ' Interrupt routine to handle each timer tick
    ' Disable interrupts during interrupt handler
    disable 
    TickInterrupt:
       Ticks = Ticks + 1                 ' Count pieces of seconds
       If Ticks < 61 Then ExitInterrupt  ' 61 ticks per second 
    
      ' One second elasped - update time
       Ticks = 0
       Second = Second + 1
       If Second >= 60 Then
          Second = 0
          Minute = Minute + 1
          If Minute >= 60 Then
             Minute = 0
          endif
       Endif
       DoUpdate = 1      ' Set update
    
    ExitInterrupt: 
        INTCON.2 = 0    ' Reset timer interrupt flag
        Resume
        end
    this is a far cry from my goal but at least a big jump for me, an unbelievable small step for mankind, maybe a step back.....
    Last edited by ScaleRobotics; - 25th April 2010 at 14:32. Reason: code tags

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