Hi! i need to make an up/down counter using a pic16f877, the count must b from 0 to 9 and 9 to 0 via PortD and must b displayed on a 7-segment display.
The control of the counting cycle must b done using two switches connected to PortA
switch 1 = Up (0-9)
switch 2 = down (9-0)
Reversal of the count must continue from previous count (don't reset counter when changing from switch1 to 2 or vice versa)
I know how to do this as i'v builded a counter before and displayed on a 7-segments! the tricky part is the reversal of the counting sequence! i don't know how to do it! what i mean is i can hav two sub routines, 1 for UP another for down, and i'll do a bit test to call them (or goto) but how would i make the pic remenber the previous count?
thanx
The control of the counting cycle must b done using two switches connected to PortA
switch 1 = Up (0-9)
switch 2 = down (9-0)
Reversal of the count must continue from previous count (don't reset counter when changing from switch1 to 2 or vice versa)
I know how to do this as i'v builded a counter before and displayed on a 7-segments! the tricky part is the reversal of the counting sequence! i don't know how to do it! what i mean is i can hav two sub routines, 1 for UP another for down, and i'll do a bit test to call them (or goto) but how would i make the pic remenber the previous count?
thanx