ECE 2534 Test #2 3/10/08
1. Write an assembly subroutine to implement the following header:
#######################################################################
# Program: WriteNibble
# Description: Writes a nibble of command or data to the LCD with the proper timing.
# Register Usage: Input: r5 contains command or data in its least significant nibble
# r6 is 0 if command, 1 if data
# Output: none
# Scratch: r7-r12
# Note: Assumes instructions execute in 20nsec (50MHz clock)
#######################################################################
.equ LCD_CONT, 0x81440000
#bits: unused | LCD_E | LCD_RS | LCD_RW | AD_CONV Keep AD_CONV low
.equ LCD_DATA, 0x81440008
#bits 28-31 are the 4 data bits.
2. Write a main routine and associated ISR in C to cause the timer subsystem to
generate interrupts every 0.25 seconds and to increment the LEDs on each
interrupt. The main routine should initialize the LEDs to zero and terminate in an
infinite loop. You may assume that a C-callable routine named MicroBlazeIE
exists to set the IE bit in the machine status register.
Unused | ENALL | PWMA0 | T0INT
ENT0 | ENIT0 | LOAD0 | ARHT0
CAPT0| GENT0 | UDT0 | MDT0
3. Explain the operation of the generate and capture modes of the timer. Give an
example use for each mode.