bananasiong
New Member
Hi,
I'm doing a dual down counter with a PIC. There is only a set of 7-segment display to display the time. User can select each counter by pressing 2 different button. There're a few more buttons: increment hour, increment minute, reset, start counting down and the two counter selection buttons.
Now I can make a single counter, quite accurate. I've tested to count down for 1 hour.
I'm still thinking of the way to make 2 counter with a single PIC and this is my plan: I've no problem with the increment state, i.e. user can increase the counting time by selecting each counter and pressing the increment buttons. When counter A is counting down and counter B is in increment mode, the delay time of the counter A is 1 second, but at the same time, the delay time for increasing the counting time of the counter B is around 100 ms, to avoid the value from adding two or more when the user press the button only once.
When both counter A and counter B are counting down, the delay time for them is 500 ms instead of 1 s, it is because the instruction is run one by one. So this will make both counter to count down second by second. My only problem is when both counters are in different mode...
I've reserved the interrupt for displaying the 7-segment displays by multiplexing, can I make another interrupt to solve my problem? Any Idea?
Thanks
I'm doing a dual down counter with a PIC. There is only a set of 7-segment display to display the time. User can select each counter by pressing 2 different button. There're a few more buttons: increment hour, increment minute, reset, start counting down and the two counter selection buttons.
Now I can make a single counter, quite accurate. I've tested to count down for 1 hour.
I'm still thinking of the way to make 2 counter with a single PIC and this is my plan: I've no problem with the increment state, i.e. user can increase the counting time by selecting each counter and pressing the increment buttons. When counter A is counting down and counter B is in increment mode, the delay time of the counter A is 1 second, but at the same time, the delay time for increasing the counting time of the counter B is around 100 ms, to avoid the value from adding two or more when the user press the button only once.
When both counter A and counter B are counting down, the delay time for them is 500 ms instead of 1 s, it is because the instruction is run one by one. So this will make both counter to count down second by second. My only problem is when both counters are in different mode...
I've reserved the interrupt for displaying the 7-segment displays by multiplexing, can I make another interrupt to solve my problem? Any Idea?
Thanks