From: "Reala" <->
Subject: Re: I/O logic problem
Date: Fri, 6 Dec 2002 17:25:26 +0800
Organization: IMS Netvigator
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
Thank you for your reply.
May be i say in this way...if i apply 3V or 0.7V to the port of MCU. Is this
What is the state of the port when it is 3V? Undetermine state?
According to you idea, it seems that the solution is using comparator.
Actually, my MCU have a 4bit resolution A/D converter. Do you think that i
can use this to solve the problem?
"Robert Baer" wrote in message
> Reala wrote:
> > Hi,
> > According to my knowlegde, normally, we input 4V or above for 5V system,
> > is High. 0.5V or below, it is Low.
> > I use a MCU, according to the datasheet, Input High is 0.8VDD minimum,
> > Low is 0.2VDD maximum. I use a IR sensor series with a resister. When
> > applied on the sensor,
> > current flow through the sensor and resister. So, by detecting the
> > drop at the resister, we can detected IR.
> > VDD-----R----------IR detector----GND
> > ^
> > Vg
> > However, my problem is that: IR source which I want to detect is too
> > compared working environment. IR in the working enviroment cause the IR
> > decter "semi-on", so, the voltage Vg is about 4V (off my IR source).
> > When i turn on my IR source, it is 3.5V.
> > It seems that both Voltage is undetermined for High or Low.
> > If I use smaller resister, Voltage drop across the R is smaller, Vg is
> > higher. However, my
> > IR source is difficult to detected, because the voltage drop across the
> > due to my IR source is very small.
> > If I use larger resister, the Vg is about 3V if i do not apply my IR
> > resource.
> > When i apply my IR resource, the voltage Vg is about 0.7V.
> > However, it is also not a good solution because 3V is not a logic high
> > (undetermine).
> > Unfortunately, I cannot increase the power of my IR source and I must
> > concern the effect of background IR in working environment.
> > Any idea to solve this problme? Thank a lot.
> > Reala
> Use an optimum value for R without any regard to the MCU; if you can,
> make a second identical circuit that "stares" off in space in a way that
> it cannot "see" your on/of source.
> This makes for a bridge - the second circuit is the reference.
> If you cannot do that, then tweak a voltage divider to the nominal
> "center" of the worst case extremes.
> If that is not possible, then make a second identical circuit that
> "stares" the same way as the first, only interchange the order of
> components - thereby increasing the differential voltage.
> Whatever scheme you use, the differential voltage goes to a
> comparitor, and the output of the comparitor drives the MCU.