Instant Interrupts - Revisited


Results 1 to 40 of 773

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Hey Darrel, I have a question about N-Bit math as it relates to DT_INTS ASM type interrupt.

    Would the ASM part of the N-Bit Math qualify as an assembly interrupt? for instance, can I do math like this in the middle of an asm type interrupt handler, without having to worry? I am not really talking about this code (your degree conversion example) but doing math like this inside an assembly interrupt handler. Or since it is using an include file, I have to worry?

    Code:
       ASM
         MOVE?WP  _degree_Total, _Temp1           ; copy degrees to a PVAR
         MOVE?CP  65535, _Temp2                   ; put multiplier in a PVAR
         MATH_MUL _Temp1, _Temp2, _Temp1          ; Temp1 = DEG * 65535
         MOVE?CP  35999, _Temp2
         MATH_DIV _Temp1, _Temp2, _Temp1          ; Temp1 = Temp1 / 35999 (16-bit result)
         MOVE?PP  _Temp1, _Temp2                  ; copy result to Temp2
         MATH_ROR _Temp2                          ; rotate right 4 times
         MATH_ROR _Temp2
         MATH_ROR _Temp2
         MATH_ROR _Temp2                          ; Temp2 is now 12-bits
         MOVE?PW  _Temp1, _Decimal_value_16bit    ; copy PVAR's to WORDs
         MOVE?PW  _Temp2, _Decimal_value_12bit
       ENDASM
    Thanks,

    Walter
    Last edited by ScaleRobotics; - 13th November 2010 at 20:30.
    http://www.scalerobotics.com

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 20:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 20:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 06:32
  5. Replies: 1
    Last Post: - 1st November 2006, 03:11

Members who have read this thread : 10

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts