??? 06/21/05 11:09 Read: times |
#95451 - I understand what Mehdi is saying..... Responding to: ???'s previous message |
I think that I understand what Mehdi is trying to say here. He is desiring how to automatically detect if a logic signal to the microcontroller is in the no-mans land between Vil and Vih. Unfortunately there is NO reliable way to detect this situation without additional hardware. The reason of this is due to the fact that the 1/0 state that you can read from the port input bit does not provide any information about the signal state if it is in the no-mans land. If the logic of the port bit was re-done so that it could report as a tri-level input as opposed to a binary state then maybe it could be that the 3rd level relates to the signal in the no-mans zone.
However there is no designed in predictability in the chip to assure that binary port bit is inside the no-mans land or not!! Here are some things that could be considered to enhance a system design so that inputs in the no-mans land are detectable: 1) Use a microcontroller that has an A/D converter with a digital / analogue MUX on the bank of port pins that want to be checked. The A/D can read out and represent the pin levels as a byte value (in case of 8-bit A/D). 2) Add an external circuit consisting of some comparators configured as a window detector that can ascertain if the signal is inside the no-mans zone or outside of it. 3) Add an AC bias to each input signal via a low cost capacitor from an AC source. Choose the capacitor so that it can couple the AC signal to the port pin when the pin is in its faulty (not properly connected) state. At the same time fix it so that the normally connected driver that would connect to the input pin has a low enough output impedance that it can successfully drive the input pin to valid levels despite the presence of the capacitor coupled AC signal. This coupled AC signal can push the faulted input port pin to a semi-predictable state above Vih and below Vil at the frequency of the AC signal. Lets say you used a 50 Hz AC source. You could then write and provide some software to detect a 50 Hz behavior on the port pin(s) to determine if they are not properly connected. Hope that helps Michael Karas |