Microcontroller input pins

Discussion in 'General Electronics Chat' started by gusmas, Nov 5, 2009.

  1. gusmas

    Thread Starter Active Member

    Sep 27, 2008
    orite i have a comparator that gives out a 4Volts signal when it is high, now i need to take that output to a microcontrolle(8051) will the microcontroller recognise that as a digital one or as a zero
  2. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    Many ICs use 'TTL' thresholds which take anything above 2V as a logic 1, so you should be OK with a direct connection.

    CMOS style input switch at about 1/3 and 2/3 supply, so again OK at 4V.

    If the comparator o/p goes below 0V when low, connect a series resistor to the MPU input to prevent damaging currents. 10K should be OK.
  3. MikeML

    AAC Fanatic!

    Oct 2, 2009
    Answer your own question: download the data sheet for the 8051. Read the section on the specs for ViH and ViL for a port pin. It is all in the data sheet.
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    It will be logical one. also remember that the input shall always be lower then the supply voltage. If you use a supply voltage (on the microchip) in range 5 to 4 every things is OK. But if you use say 3.3 volt as supply voltage you may damage your UC
  5. gusmas

    Thread Starter Active Member

    Sep 27, 2008
    ok so just a series resistor(10k) from the output of the comparator to the input pin of the microcontroller, that will prevent any damaging to the microcontroller?
  6. mik3

    Senior Member

    Feb 4, 2008
    What is the output voltage of the comparator when it is low?

    Which comparator is it?