Advanced Member level 3
hi all i want to increment my 7 seg nuber from its currernt value if increment key pressed and same as in decrement case can any one help i am using 89c52 with three 7 seg and 4x3 matrix key pad
You don't need a counter IC. All this can be done in the microcontroller code.A counter IC would use this sequence. Adapt it as needed. Change hi to lo or lo to hi to operate IC's properly.
1. Detect key press inc or dec.
2. Debounce key press and ignore further key presses for 1/4 second or so.
3. Set IC count mode pin hi or lo, depending on whether you want to count up or down.
4. Use an RS flip flop. Clock goes to one input.
5. Set other input so output changes to hi. You can use a one-shot to apply short pulse.
6. Flip-flop output goes to IC gate-enable count pin.
7. The next clock pulse will enable count for one pulse.
8. End of clock cycle resets flip flop. Flip flop output disables gate count pin.
9. Update 7 seg display.
10. Accept key presses.