Design a counter for the PIC18F46K42 microcontroller using MPlabX.
The microcontroller will connect to one 7-segment and two button switches. One switch must count up from 0 to 9 the other switch must count down from 9 to 0. This count will be visually shown on the 7-segment.
The principle operation will look as such:
If you press and hold switch A the 7-segment will show numbers moving up. For example 0,1,2,3,4,5,6,7,8,9,0,1,2,3,,x...... If you stop pressing Switch A the count must stop and the last number (in this case x) must be displayed.
If you press and hold switch B the 7-segment will show numbers moving down. For example 9,8,7,6,5,4,3,2,1,0,9,8,7,y..... If you stop pressing Switch B the count must stop and the last number (in this case y) must be displayed.
If you press and hold A and B together the 7-segment will show 0 and stop (reset)
If no switch is pressed 7-Segment should be displaying the last number or the default number which is Zero.
The requirements:
The GPIO port that will be used for the inputs will be PORTC.
The GPIO ports for the outputs will be PORTD.
For the states of the switch, when they are not pressed, then the states will be low. When they are pressed, the state will be high.
There MUST be a 1 second time delay for each number on the 7-segment.
The CALL command MUST be used for each function (delay, incrementing, decrementing, rest, etc)