Floating point expression looking for integer math solution


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Lightbulb a good hard ... allows easy soft !!!

    Hi, Castor

    May be there would be a smart turnaround ...

    if , instead of R1, you use a constant current generator ...

    say a PNP trans, with a red led between VCC and base, a resistor between emitter and VCC to fix your current ...
    and another resistor between base and GND to allow, say, 1 mA into the led + trans base.

    good idea, no ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Short on time but this might get you started

    Rewrite this
    R2=10.000/[(5000/ad_res)-1]
    to look like this
    R2=10.000*ad_res/[5000-ad_res]

    calculate the denominator and keep (5000 - ad_res)
    Calculate the numerator (10.000*ad_res)
    Use Div32 to divide the numerator by the denominator

    Use Darrel's method to get the remainder

    http://www.picbasic.co.uk/forum/showthread.php?t=1942
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Or even easier (I think) to use a DS1820 type sensor.
    There has to be at least a dozen examples here on the forums.

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, Ski

    Good idea ...

    and if being really time-short a LM 35/335 ... could also do it !

    But what replacement for my .5 mm dia thermistors ( from aerospace industry ) ??? didn't find yet ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Apr 2008
    Location
    Berlin, Germany
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    I used Paul's sollution and it works great !

Similar Threads

  1. Strugling without floating point
    By pjsmith in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 27th March 2011, 06:29
  2. Floating point math
    By Glenn in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th January 2009, 03:47
  3. Floating Point Display Problem (serial string out)
    By Cash Olsen in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th December 2007, 02:03
  4. Microchip Floating Point Routines
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th October 2006, 19:51
  5. DIV32 instead of floating point routines?
    By Tomasm in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd April 2004, 07:50

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