??? 06/09/08 22:20 Read: times |
#155640 - the PISO register is loaded only once ... Responding to: ???'s previous message |
He's got a 24-bit array of switches fed to a 24-bit PISO register. He samples the switch once to load the PISO shift register. Then, he clocks the shift register 24 times to present each sampled switch state to the MCU. Debouncing requires that one "see" a transistion, wait for it to settle out, and then, after some time, continue to "see" the same state. Unless he uses a very slow process (possible, but not verified so far), and repeats the sampling sequence multiple times he can easily capture a "wrong" state during the bounce (typically 20 ms).
Back when I built front panels quite routinely I simply used a 4K7 series resistor paired with a 10 nf cap to Gnd into a Schmidt-trigger buffer (74C244, unlike LS, HC/HCT, etc, is Schmidt-triggered.) which swallowed the bounce pretty well, but then, I did use a signal to tell the MCU that I had changed the switch settings. Of course, I didn't use a shift register, which, in itself, poses a number of problems because one has to know when to load the shift register, i.e. when the switches are stabile. Clearly the O/P has the opinion that he's subject to considerable noise and EM interference, else he wouldn't be worried about suppressing it. Once he knows how much energy there is in such unwanted rubbish, he can develop a filter that relies on his PISO's input capacitance by selecting a resistor that swallows the random bounce transitions on his switches, but only if the net impedance is considerably lower than that of the ambient noise he wishes to suppress. He is where the problem is, so he'll have to figure out whether that's feasible. If possible, it's quite elegant, as it uses what's there instead of adding more "stuff." A half-meter-long wire on each switch is not that much of an antenna for this sort of signal. RE |