Lab 6

Scroll a message using the FPGA interval timer

Debugger setup

CPUlator simulatorC · DE1-SoC Nios V computer, simulated in your browser. No board or sign-in needed.

  1. Get the sourceDownload main.c
  2. Open the simulatorOpen CPUlator

Use an FPGA peripheral to provide a 10 ms tick for the six-digit scrolling message. Every fifty timeouts should advance the display by one character. The starting program displays the first window and then stays there.

Program the peripheral

In CPUlator select C, open main.c and choose Compile and Load (F5). Locate the Interval Timer peripheral at 0xff202000. At 100 MHz, a 10 ms interval takes one million ticks. The inclusive countdown starts at 999999. Split that value into its low and high 16-bit halves and compare them with the writes in start_timer. Locate the START and CONT bits in the control word.

Diagnose the frozen display

Press Continue (F3). Record whether Interval Timer shows Once or Cont. and Run or Stop. Why can the timeout flag be clear even when the device has already expired? Change the control value to produce repeated timeouts. Leave interrupts disabled; the program polls and clears the flag.

Measure the output

Write down the eight successive six-character windows, marking blanks with a dot. Press and release KEY0, wait one second and check that the same window remains. Press and release KEY3 to resume. Finally change HUNDREDTHS_PER_STEP from 50u to 25u, recompile, and time a full cycle in both builds. Explain which timer settings stayed fixed while the scroll rate changed.

Original LabsLand activity following FPGAcademy Computer Organization Lab 6, Part VI. FPGAcademy PDF · MIT

Run a signed maximum on a physical Nios V board