FP routines with PBP


Results 1 to 6 of 6

Threaded View

  1. #4
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Skimask,

    Although it is late now, here is something I would try ...

    Bash out all the constants as you noted ( 604.365, 710.734). You are left with

    604.365VSS/MAF and 710.734VSS/MAF

    Multiply these by 10 and keep the integer part (for added accuracy).

    Const = 6044 or 7107

    ANS = CONST * VSS
    ANS = DIV32 MAF

    Then use Darrel's trick to retrieve the remainder

    http://www.picbasic.co.uk/forum/showthread.php?t=48

    Put it back together as needed (Darrel shows this in his thread). This skips even the pain of Fixed Point if it works for you.

    Do you need to use the answer in additional math or just display it?
    What accuracy do you need?
    If you want to pursue Fixed Point then the standard 24.8 format would work (2 word variables)

    Oh, it's too late to guess - I'll try that tomorrow - over and out


    EDIT: MAF would have to be greater than or equal to 23 or 27 (depending on 6044 or 7107, respectively) in order for the DIV32 result to be less than 65536 - if they were not, you would have to tweak the math or check the ratio of VSS/MAF before the mult / DIV32 - clear as mud?
    Last edited by paul borgmeier; - 15th January 2007 at 08:34.
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. Extensions to PBP variables
    By John_Mac in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd October 2009, 05:21
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30
  5. PBP / XP Crash
    By pondindustrial in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 27th November 2005, 03:16

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