If you need a *very* small program to debounce a switch, how about none at all? Could you use a couple of resistors, a cap, and an (optional) inverter to do an analog debouce rather than a software one? Vcc | ---------| | | | --- C1 | 0 --- .1uFd | | |\ Any left over NAND gate, etc. SW1 -| |--------------| >O-------[OUTPUT> N.O. | | |/ Of course a Schmitt Trigger | 0 / R1 would give the best results | \ 470K | / | \ | | |--------| | / R2 \ 10K / \ | ----- --- - In fact, the inverter is a luxury that you may be able to do without. The values of the components can be altered to give you the amount of charge/discharge that you want. The values in my (poor) ASCII art are nothing special. Just some from an old project that seemed to work OK. Just remember that, when the switch is closed, R2 is across your power supply, so make it large enough to not burden Vcc. Michael When the way of the Tao is forgotten, kindness and ethics must be taught. Men must learn to pretend to be wise and good. -- Lao Tzu