Using the m-Vison Keil compiler and associated? debugger/simulator you are required to design and simulate a microcontroller based general purpose timer. The timer value is set using a rotary incremental shaft encoder and the timing is started with a momentary push-button switch. A serial port can be used to display messages and variable values.
? The time value in seconds (0 to 99 seconds) is input by the user via a rotary incremental shaft encoder. The user generates the time period by rotating the rotary incremental encoder clockwise or anticlockwise. The encoder produces two square wave signals, corresponding to logic 0 and logic 1, called PHASEA and PHASEB. The two phase signals should to be connected to bit 0 and bit 1 of port 4 respectively. You should define these in your program as shown in the outline program attached.
As the user rotates the shaft encoder in a clockwise direction PHASEB is logic 1 when PHASEA changes from logic 1 to logic 0. As the user rotates the shaft encoder in an anti-clockwise direction PHASEB is logic 0 when PHASEA changes from logic 1 to logic 0.