>After ten years programming a machine in a noise >environment, have adopted the practice to debounce >every digital input from a sensor as well as I/o >lines from other controllers. Even find myself >wanting to debounce flags that I set myself under >software control. Been there, done that. The memorable instance for me was when dealing with a computer system that was being built to work in a freezing works (abattoir, killing chain) so had to withstand a noisy environment with motor speed controls etc. Set up in the lab it worked fine, until someone plugged in a small fluorescent lamp (which was often used as a test source of mains spikes) and kept flicking the on/off switch for rather more times than was necessary. The resultant printing out of messages about lack of sync between the carcase chain detector and some other signal that it used for syncing caused someone to reset the machine rather than wait for the ASR33 to grind through an innumerable number of lines of printout. I got the job of putting in a one shot circuit on the relevant sensor line that acted in a similar manner to the UART start bit detection filter - pulse has to be present for a certain period of time to be considered a valid pulse. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist