??? 10/22/09 16:16 Modified: 10/22/09 17:12 Read: times Msg Score: -1 -1 Answer is Wrong |
#169981 - The first obvious sign of failure Responding to: ???'s previous message |
The MCU has an external interrupt pin. How is that pin configured in software? For example, that little guy can be edge triggered or it can always trigger when at a level meaning you could get multiple interrupts. Secondly, humidity/temperature will cause a change in your oscillator depending on how it is constructed. This being said, if you configured your MCU to work where the thing is always interrupting at a level, well it could have worked for a while until the oscillator degraded due to environmental conditions because your code could be perfectly timed to only show one interrupt. In reality, it is not a stable system. If you only want one interrupt configure for edge trigger only and this would be regardless of how you made your oscillator. On top of this, you should have a buffer chip utilizing a Schmitt trigger with distinct levels as mentioned before that reads high or low regardless if it is digital or analog just to protect the input circuitry of the MCU. To go further, anything from the outside world needs to have a default (high or low) set by hardware protection. This is just common practice that not many engineers invoke. Regarding your optocoupler, just because you use a logic level optocoupler does not necessarily mean that you will get a distinct output (unless the input or output is dictated by a Schmitt trigger). Using a buffer chip utilizing a Schmitt trigger right after the sensor and tying into the optocoupler will insure a non-floating signal. I take it the proximity sensor is analog, of course, meaning you will have to have hardware protection before the buffer chip. Since youve used a new proximity sensor, the doubt is in your circuitry and programming. |