??? 09/22/04 02:14 Read: times |
#77913 - RE: Debounce, and define current problem Responding to: ???'s previous message |
Hi Craig,
To answer the questions from your previous post: Actually the correction I remember had something to do with an address being wrong. Someone pointed out that the 8255 address was usually something else and you indicated that he was right. The other person (I think it was Steve) that said the address of Port A was usually something else was correct. But the code in question was loading the register which controls PORT A with a control word that configures PORT A. So in essence we were both correct. What is the current problem you are experiencing with the code you just posted (the one with debounce)? Does it constantly flash the LED, too? Is the flashing at a constant speed or is it sporadic? If I happen to get into the right rhythm when pushing the switch it operates as expected otherwise it may just blink or not even respond to the push of the switch. Finally I questioned my professor further today about the debounce and he insisted that all a debounce is, is just a delay after reading the switch to wait for the signal to stabilize. He said perhaps my problem is the length of the delay (which he recommended). So I made delays ranging from 10mS on up to 1 sec, still no good. I'm working on implementing your recommendation using a register as a counter. I'm not quite sure yet about how exactly to do it as I haven't figured out how it would look in a flowchart. It will be pretty neat to show him a true debounce though. I wanted to reply tonight so you didn't think I was rude. I'll let you know on Thursday (I have to work tomorrow) how it's going. Thanks again. |