EE307P Lab Experiments
Experiment 1: Familiarization with 68HC08 Microcontroller kit
Familiarize yourself with the following terms, tools, and hardware components:
Microcontroller or MCU
Erasing and Programming Flash Memory
At the end of the experiment, you must be able to Understand the essential instructions in the 68HC08 MCU Understand the memory map in the MCU Locate the various software tools available as part of the lab. Identify the different components on the microprocessor kit. Explain what an embedded system is Understand what is meant by flash memory Explain the difference between a microprocessor and micro-controller Use the WinIDE tool.
Download a given assembly language program, assemble, and run the program.
Experiment 2: 68HC08 Assembly language programming
Develop an assembly language program to compare two character strings stored at locations 0080h and 00a0h. Each string is terminated by the NULL character (ASCII 0). The output of the program is as follows. IF String1 < String2, then Bit 0 of Port A will be set. If String1 > String 2, bit 2 of Port A will be set. If the strings are equal, bit 1 of Port A will be set.
Assemble the program and correct any syntax errors. Run the program in the simulator and correct any logical errors. Run the program after modifying the strings to exercise all the three conditions, namely, String1 < String2, String1 = String2, and String1 > String2.
(b) Develop an assembly language program for the following application. Given an ASCII string, you must generate the MORSE code for the string. MORSE code, used by HAMmers, uses only two symbols to represent each English alphabet, namely, the "dot" and the "dash." Given below is a table of MORSE code for the first six English alphabets. (If you want the whole table, search the Web!)
Thus, to transmit the string "FACE", you will have to transmit ..-..--.-..
The input to your program is a string stored at location INPUT. The output is a string stored at location OUTPUT. Use ASCII "." And ASCII "-" to represent the dot and the dash.
Experiment 3: Develop an assembly language program for the following
Six LEDs (light emitting diodes) are arranged in the form of a circle on a breadboard. The MCU provides signals to the LEDs so as to light them one at a time. The order in which the LEDs light up is clockwise to start with. When the MCU is interrupted, the order toggles. In other words, if the order is clockwise before the interrupt, the order will change to anticlockwise after the interrupt (and vice versa).
Step 3.1: Write the assembly language program for the application and test it out. Generate IRQ signals manually. Understand how to set the CCR register, how to initialize the reset vector, etc. Some precautions that you must take are:
Develop the hardware on breadboard, including the LEDs. Step 3.2: Connect the microprocessor kit to the PC. Use the output port signals from the MCU to control the LEDs.
Step 3.2: Download the code of your program to the flash memory of the MCU and then run the program through the MCU and use the in-circuit debugger to run the program. Use a wire to generate the IRQ requests.
Experiment 4:Roulette Game
Five LEDís are arranged in the form of a circle on a breadboard. These represent numbers 1, 2, 3, 4, and 5. The user of the game can bet on one, two, or three of these numbers. The LEDs glow one at a time in the clockwise direction (as in Experiment 3 above). The user can interrupt the game at any time. If the LED that is glowing at the time when the interrupt signal arrives happens to be one of the LEDs that the user of the game has placed her bet on, then the user wins. Otherwise, the user looses. If the user wins, her score
3 points if the user has bet on a single LED
2 points if the user has bet on two LEDs
1 point if the user has bet on three LEDs
If the user looses, then the score of the user will be 0.
The score must be displayed using a 7-segment display or as a binary number through 2 LEDs.
Follow instructions similar to the ones given in the previous experiment i.e. write the assembly language program to implement the game and test it. Then connect the microprocessor to the PC and do the in-circuit simulation. Finally burn the program to the flash memory of the MCU and run it through the in-circuit debugger. Use a wire to generate the interrupt.
Experiment 5: System Prototyping (2 turns)
You can select a project after discussing it with the instructor. The project can be any application of the HC08.