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

logic program

hi sir
iam using 89c51 with C51 compiler
i want display voltage on & four 7segment leds.I converted anlog voltage to digital
using ADC.now i want display voltage on & 7-segment leds like
0.001v
0.002v
.
.
.
5.000v

iam using only one port P1 conacted to the 7-segmentLEDs and i conacted 4 transisters
to the port-P2 like P2.1 p2.2 p2.3 p2.4.
how to selact the transister according to voltage
pleace give one C program on this logic

Thanks.

chandu

  • "how to selact the transister according to voltage"

    The transistors select which digit is currently active - they have nothing to do with the voltage!

    You need to select each digit in turn by activating the appropriate transistor, then write the value for that digit to P1:

    REPEAT
       activate digit 0 via P2
       write digit 0 value to P1
    
       activate digit 1 via P2
       write digit 1 value to P1
    
       activate digit 2 via P2
       write digit 2 value to P1
    
       activate digit 3 via P2
       write digit 3 value to P1
    FOREVER

    By doing this fast enough, the human eye is deceived into thinking that all the digits are continuously illuminated (due to the effect known as "persistence of vision")

  • thank u sir
    thank u for u r reply
    u r saying we have to put continous loop for display
    if i change input voltage then what happends to the display value.

  • "thank u for u r reply"

    Unless you have some physical disability that impairs your use of the keyboard, please make the effort to type "you", "your", etc, in full.

  • sorry sir

    you are saying that we have to put continous loop for display
    if i change input voltage then what happends to the display value.

    regards

    nari

  • "if i change input voltage then what happends to the display value."

    Surely, you want the displayed value to change?!

    So, each time you update a digit, be sure to write the current value for that digit!