RPM - DIV32 Problem


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    The little problem is that you MUST use variable in your 16x16 bit multiplication, unless it's not going to work.

    Code:
            rlow var word
            rhigh var word
            rtotal var word
            RPM VAR WORD
            tbase var word
            a var word
            b var word
            a=500
            b=600
            '
            '        
            '
            rhigh=1400
            rlow=1400
            rtotal = (rhigh + rlow) /10
            tbase = a*b
            rpm = div32 rtotal
    this return 1071

    you should have better resolution with...
    Code:
            rlow var word
            rhigh var word
            rtotal var word
            RPM VAR WORD
            tbase var word
            a var word
            b var word
            a=5000
            b=600
            '
            '        
            '
            rhigh=1400
            rlow=1400
            rtotal = (rhigh + rlow)
            tbase = a*b
            rpm = div32 rtotal
    Last edited by mister_e; - 11th April 2008 at 04:20.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Interrupt RPM and Taylors Elapsed time on 18F4620
    By Tobias in forum mel PIC BASIC Pro
    Replies: 70
    Last Post: - 3rd February 2010, 16:12
  2. Slow code needs a tune up
    By Tobias in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th January 2010, 15:05
  3. Pulsin vs. Interrupt RPM measurement
    By Tobias in forum General
    Replies: 1
    Last Post: - 31st December 2009, 01:29
  4. 16f877A and tmr1 external crystal question
    By comwarrior in forum General
    Replies: 3
    Last Post: - 13th July 2009, 00:40
  5. Problem with Div32
    By lerameur in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd April 2008, 02:54

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