Spring 2000
ENSC 151
DIGITAL AND COMPUTER DESIGN LABORATORY

Assignment #2: Word Processor

Posted: February 1, 2000
Due: Monday, February 14, 2000, by 16:00 in the ENSC departmental office
Extended deadline: Wednesday, February 16, 2000, by 24:00 in the ENSC departmental office


Using the current Altera hardware configuration which connects the four push buttons to the /IRQ pin on the HC12 and connects each button to a pin of PORT A, develop an interrupt service routine that prioritizes the button pushes and executes a different command associated with each pushbutton.

The push button functions should be, in order of highest to lowest priority. (Note: Implementation of the priority among the buttons is recommended but optional.)

Flash the cursor at all times so you know where it is located on the LCD.

To move from one row to the next, make sure the move left and right functions have the ability to wraparound to the next row of the LCD. If the cursor moves off the left side of the top row, it should reappear at the right side of the bottom row, and vice versa. The same should hold for the end of the bottom row: the cursor should rotate back up to the left side of the top row. HINT: Recall the size of the LCD that you see, and the actual size of the LCD that the HC12 sees.

Keep in mind that there is only one /IRQ pin, and one IRQ service. Hence, your interrupt routine must be able to decode which button has been pushed. Recall that the buttons are connected to PORT A.

Each time you draw a character, start at "A". Every time you move to a new cursor position, start scrolling through the characters starting with "A".

OPTIONAL: There is a lot of "bounce" on the switches of the Altera board. Make sure that your program is not sensitive to this phenomenon. This problem can be solved by writing a creative algorithm on the HC12 using pauses.

Marks are awarded for efficiency of the coding and the algorithm. Make sure to comment your code.


Last modified: Friday February 11 19:42:30 PST 2000.