Create an assembly language program on the 9S12 CPU to readswitches and drive LED's
1-Configure all bits of Port U for output using address DDRU.There are 8 LEDs
connected to those pins. When you output a 1 to a bit, that bitwill be enabled for
output, so when you later write a 1 to a bit in port U (PTU)that LED will turn ON.
2. Switches are attached to Port T. They work by grounding thebit when switched
on, (negative logic): ON = 0, OFF = 1. The PCB supplies pull-upresistors.
3. Read the switches, and configure your program so that ifswitch 1 is on, you
send out a data pattern which will make the even LEDs turn ON,others OFF.
4. If switch 2 is on, make the lower 4 LEDs ON and the higher 4LEDs OFF
5. If switch 3 is ON, start out lighting the LED for bit 0, thenmove the light left until
the LED for bit 7 is ON. After that, turn OFF all LEDs, thenturn on the LED for a bit
7 again and move the light back towards the LED for bit 0. Afterit gets there, turns all the LEDs OFFagain, then repeat the cycle until the switch changes).
Note: for all of the above you will have to keep going backafterward andreading the switch to see if it has changed.
6. Add a delay to your program so the human eye can see theoperation!