??? 06/22/05 00:37 Read: times |
#95540 - Detect What? Responding to: ???'s previous message |
There are possibly two decidedly different things that Mehdi may be asking about. One thing is to detect an actual circuit failure. In this case I am firmly in the camp with the others, including Erik, that question the wisdom of adding extra hardware for the purpose of detecting circuit failure. There are many variations of this however and each system design deserves a FMEA (failure mode effects analysis). Certainly no one can argue against the addition of a cheap bias tie off resistor on an A/D input to a microcontroller to force an input at the rail in the case that a connector pin or wire from a sensor connection breaks. On the other hand it is fruitless to try add globs of extra circuits just to see of a microcontroller pin becomes intermittent on its pad (unless this signal pin demands the utmost in safety checking).
The other aspect of what Mehdi may be asking about is auto detecting when certain critical (and/or optional) equipment is attached to a microcontroller system. In these cases there are good and bad ways to prepare the system design. An example of a bad thing is to leave port pins floating in the case that an equipment connector is left unconnected. Such pins should be biased appropriately with buffers or at least pullup resistors. On the other hand several good things that can aid in auto detection of options and attachments being present include: 1) Add a resistor on an option unit that is biased from a divider on the microcontroller board. Use an A/D converter to read the voltage drop across the resistor and qualify the option a present based upon a narrow acceptance window of the A/D reading. A variation of this idea can be used to ID several options on the same interface connection. 2) Add two extra pins in a cable that connects an option. Loop back one cable signal to the other at the attachment end. Then on the microcontroller end have one of the signals wire to an output pin and the other end go to an input pin. Software can wiggle one signal and look for an equivalent response on the other pin as a means of validating the equipment connection. 3) If an optional device attaches via a data interface of some sort (serial or parallel) have the optional device emit a periodic signal (sometimes called a "keep-a-live" or a "heart beat") that allows the microcontroller to keep track that the optional or critical attachment is "still out there". Michael Karas |