SPWM and Elapsed Timer


Results 1 to 13 of 13

Threaded View

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


    Did you find this post helpful? Yes | No

    Default Elapsed Timer for TMR2

    Quote Originally Posted by CocaColaKid View Post
    Would you be able to help with the ASM part of it as it is for the most part greek to me.
    That's too bad....
    ASM is the Best part of Picbasic Pro.

    Learning one without the other is like buying a space shuttle without the solid rocket boosters.
    It looks nice, but it's not going to take you where you want to go. <hr>
    Ok, here ya go.

    The Elapsed Timer for use with Timer 2.

    Code:
    <font color="#0000FF"><b><i>; Initialze your hardware and LCD first
    
    </i></b></font><font color="#008000"><b>INCLUDE </b></font><font color="#FF0000">&quot;DT_INTS-14.bas&quot;     </font><font color="#0000FF"><b><i>' Required
    </i></b></font><font color="#008000"><b>INCLUDE </b></font><font color="#FF0000">&quot;Elapsed-T2.bas&quot;     </font><font color="#0000FF"><b><i>' Elapsed Timer for TMR2
    
    </i></b></font><font color="#008000"><b>ASM
    </b></font><font color="#000080">INT_LIST  macro    </font><font color="#0000FF"><b><i>; IntSource,        Label,  Type, ResetFlag?
            </i></b></font><font color="#000080">INT_Handler   TMR2_INT,  _ClockCount,   ASM,  yes
        endm
        INT_CREATE               </font><font color="#0000FF"><b><i>; Creates the interrupt processor
    
        </i></b></font><font color="#000080">INT_ENABLE  TMR2_INT      </font><font color="#0000FF"><b><i>; Enable TMR2 Interrupts  
    </i></b></font><font color="#008000"><b>ENDASM
    
    GOSUB </b></font><b>ResetTime
    </b><font color="#008000"><b>GOSUB </b></font><b>StartTimer
    
    Main</b>:
        <font color="#008000"><b>IF </b></font><b>SecondsChanged </b>= <font color="#800000"><b>1 </b></font><font color="#008000"><b>THEN
           LCDOUT </b></font><font color="#800000"><b>$FE</b></font>,<font color="#800000"><b>2</b></font>, <font color="#008000"><b>DEC </b></font><b>Days</b>,<font color="#FF0000">&quot;d-&quot;</font>,<font color="#008000"><b>DEC2 </b></font><b>Hours</b>,<font color="#FF0000">&quot;:&quot;</font>,<font color="#008000"><b>DEC2 </b></font><b>Minutes</b>,<font color="#FF0000">&quot;:&quot;</font>,<font color="#008000"><b>DEC2 </b></font><b>Seconds
           SecondsChanged </b>= <font color="#800000"><b>0
        </b></font><font color="#008000"><b>ENDIF
    GOTO </b></font><b>Main</b>
    Attached Files Attached Files
    DT

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