??? 09/20/04 15:40 Read: times Msg Score: +2 +2 Good Answer/Helpful |
#77721 - RE: Problem with my code Responding to: ???'s previous message |
No, it was provided by school Yes understood. And by now you MUST have understood that the 8255 belongs to a group of peripheral support chips developed by Intel more than a decade ago. They were fine at that time when you had 8085, EPROM and the like. But the current generation of Flash MCUs, Expanded RAM MCUs, Extended port capabilities and mixed signal MCUs have pushed these ( 8255, 8253,8279 etc ) to the museum. So you are stuck with the 8255. Before you decide to dump it, just give it a go - get all its registers and command options by heart. And looks like you just want to toggle an LED everytime the user presses a button. For this 2 nos 8255 is an overkill by any standards !! 8255 or not, the logic ( pseudocode?) is this : - Poll the input Bit connected to the user button. - On State Change, start a debounce timer ( 20ms?) - On end of timing check validity of state change. - If the state change is still valid, toggle LED state. - If state change is in-valid, go poll input bit. Code the above and the LED will do your bidding. Raghu |