This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pressure

hi sir

i need one help

now iam doing project on 89c51 using C51 Evaluation Software

i converted 0-5 analog volatge to 0-5 digital voltage .

now i want convert digital data to pressure

my output should be like this

0v 1.1E-1 3v 4.1E-4
0.1 1.2E-1 4v 5.1E-5
1v 2.1E-2 5v 6.1E-6
2v 3.1E-3

i want 500 values in between 0 to 5 volts
how to calibrate the voltage interms of preesure
what logic i want use to convert Voltage to pressure
my C51 not taking floting oparations

please help

regards
chandra sri

Parents
  • "in my project iam using 4 seven segment display for to display the pressure."

    Do you mean a four-digit 7-segment display?

    If so, how do you plan to display, for example, "4.1E-4" on four 7-segment digits:

    4. = 1st digit
    1  = 2nd digit
    E  = 3rd digit
    -  = 4th digit
    4  = Oops! no more digits!!
    Or, as all the values contain the 'E' and '-', will they just be permanently marked on the panel?
    In which case, you only need 3 digits - not 4!

    "please tell how to..."

    No - you need to learn how to think these things out for yourself!

    The Lookup-Table technique can still be used; you could even still make it a table of strings.
    Instead of using printf, you just write the 1st character of the string to the left-most 7-segment digit, and so on...

    Using a table of strings for this is probably quite inefficient, because:
    1. each string has a null-terminator added, which you don't need;
    2. the actual table contains pointers to the strings (textbook basics) - so these pointers have to be stored in addition to the actual strings, With such small strings, this is a significant overhead!

    A more compact way would be to use a two-dimensional array...

    Textbook time, again!

    "Because printf is taking lot of memory"

    Yes, printf does take quite a lot of memory.
    But, in this case are you sure that it's printf that's the real problem - or is it just the size of the table?

Reply
  • "in my project iam using 4 seven segment display for to display the pressure."

    Do you mean a four-digit 7-segment display?

    If so, how do you plan to display, for example, "4.1E-4" on four 7-segment digits:

    4. = 1st digit
    1  = 2nd digit
    E  = 3rd digit
    -  = 4th digit
    4  = Oops! no more digits!!
    Or, as all the values contain the 'E' and '-', will they just be permanently marked on the panel?
    In which case, you only need 3 digits - not 4!

    "please tell how to..."

    No - you need to learn how to think these things out for yourself!

    The Lookup-Table technique can still be used; you could even still make it a table of strings.
    Instead of using printf, you just write the 1st character of the string to the left-most 7-segment digit, and so on...

    Using a table of strings for this is probably quite inefficient, because:
    1. each string has a null-terminator added, which you don't need;
    2. the actual table contains pointers to the strings (textbook basics) - so these pointers have to be stored in addition to the actual strings, With such small strings, this is a significant overhead!

    A more compact way would be to use a two-dimensional array...

    Textbook time, again!

    "Because printf is taking lot of memory"

    Yes, printf does take quite a lot of memory.
    But, in this case are you sure that it's printf that's the real problem - or is it just the size of the table?

Children