16f877 with LM335 problem


Closed Thread
Results 1 to 40 of 47

Hybrid View

  1. #1
    Join Date
    Nov 2006
    Location
    Melbourne, Australia
    Posts
    25


    Did you find this post helpful? Yes | No

    Angry Still seeing red with the ADC

    Quote Originally Posted by Ioannis View Post
    Did you really bought the copy of PBP you have????

    Did it came with it a MANUAL ???

    Did you read the MANUAL ????

    Didn't find any reference as to that PBP is NOT supporting floating maths ???

    I am looking forward to you replying to the above so that we can continue support here.

    Ioannis


    P.S. If you are just connect the sensor to the PIC directly, your useful range will be limited (0C-100C is from 2,7315 to 3,7315 Volts). I suggest to use opamps and extend the range of the sensor from 0C->0Volts to 100C->5 Volts.
    thanks for the quick responce

    got PBP 2.47 from DONTRONICS here in melbourne

    Yes. Read the 213 pages and even been looking up web sites with references. downloaded the data sheet read the A2D converter module.. CH 11 pg 127

    ok just found 1 error in setting the TRISA had 8 bits set to 1 should have been 6 ie TRISA %111111 not TRISA %11111111

    still not workin. even connected a 5k lin pot and got no responce.


    and as Ioannis said using an opamp to extend the range i will be now

    MY CODE WILL NOT COMPILE WITH THIS LINE
    AD_RESULT = (ad_raw *0.48828) - 273.15

    Had to do it this way
    ad_result = (ad_raw * 48828)/1000
    ad_result = ad_result/100
    ad_result = (ad_result *27315)/100
    WHY????????????????????????????????????????
    HMMMMMMM very frustrating
    IF ITS STOCK IT WONT ROCK

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by CrazyCooter View Post

    MY CODE WILL NOT COMPILE WITH THIS LINE
    AD_RESULT = (ad_raw *0.48828) - 273.15

    Had to do it this way
    ad_result = (ad_raw * 48828)/1000
    ad_result = ad_result/100
    ad_result = (ad_result *27315)/100
    WHY????????????????????????????????????????
    HMMMMMMM very frustrating
    What do you mean why? Did you read the post earlier? Did you really read it? Let me quote one line from that earlier post:

    "Did you read the MANUAL ????

    Didn't find any reference as to that PBP is NOT supporting floating maths ???"

    How many times do we have to point out to you that PBP does not support floating point math! And if you don't understand the term 'floating point', well, quite frankly 'floating point' means that the decimal is 'floating'...it can move wherever it needs to go according to the math being performed!
    PBP DOES NOT SUPPORT FLOATING POINT MATHS! The decimal point is stuck in one place, all the way to the right, no matter what you do, the decimal point will always be to the right...no fractions, no tenths, no hundreths, no nothing. If you divide 10 by 3, you'll get 3, nothing more nothing less. If you use the remainder function, yes, in the case above, you'll get a 1 from it, but it's still not FLOATING POINT...

    Somebody get me a drill!!!

  3. #3
    Join Date
    Nov 2006
    Location
    Melbourne, Australia
    Posts
    25


    Did you find this post helpful? Yes | No

    Smile

    Thanks skimask for pointing that out.

    ok so i am 1 step closer to getting this to work now.

    so the only way to do floating point maths then is with asm right?

    and thats why my code will not work correctly with the LM335 and the ADC?
    IF ITS STOCK IT WONT ROCK

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


    Did you find this post helpful? Yes | No

    Talking Humour of life ...

    QUOTE << Hi, Skimask

    You can also remember Every number can be close-rounded as the division of two integers ... ( PI = 22/7 i.e. )

    That give some brain work to find the couple of the year ... but a small GWBASIC ( LOL !!! ) program can easily sort them.

    With the use of the DIV32 function ... that enables more than you ever dreamed !!!

    Alain >>

    Hi, Scooter

    Sometimes, life is really funny ... that comes from 5 threads down on the list ...
    ************************************************** ***********************
    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
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by CrazyCooter View Post
    Thanks skimask for pointing that out.

    ok so i am 1 step closer to getting this to work now.

    so the only way to do floating point maths then is with asm right?

    and thats why my code will not work correctly with the LM335 and the ADC?
    Sure, because a byte/word/bit/whatever has a decimal point in it when written in plain text...

    It's possible to do plenty of floating point when using straight PBP, as many digits as you want, as much accuracy as your heart desires......the question is, can you?

  6. #6
    Join Date
    Nov 2006
    Location
    Melbourne, Australia
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    It's possible to do plenty of floating point when using straight PBP, as many digits as you want, as much accuracy as your heart desires......the question is, can you?
    I have no understanding of asm so would take me a very long time to understand and implement.

    2 decimal places is more than accurate enought for what i want to be doing
    and all the adc will be from 0V to 5V in 10 bit

    as Ioannis said "check the manual and forum for applications of DIV32, */ and // operators. These are what you need to do the job."

    thanks everyone see how i go trying this
    IF ITS STOCK IT WONT ROCK

Similar Threads

  1. 16F877 HSERIN problem with 3th party software
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 11th March 2009, 18:11
  2. LCD problem with 16F877
    By alexx_57 in forum General
    Replies: 10
    Last Post: - 25th July 2007, 14:47
  3. problem using 16f877
    By yrch in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th February 2006, 19:58
  4. 16F877 20MHz problem
    By swordman in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 31st July 2004, 11:02
  5. 16F877, DS18S20 and Serial Comm Problem
    By YellowTang in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th April 2004, 11:36

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