Using the serial port as an E100 console

One reason debugging E100 programs is hard is because it's hard to display output (other than small amounts of output to the LEDs, hexdigits, and LCD module). This web page explains how to print output to a console, as you would in other programming environments.

The basic idea is to use the E100's serial port as a console. This involves two parts:

  1. Send the ASCII values for the characters you want to print to the serial console. E.g., to print abc, send the numbers 97, 98, 99. To print a newline, send the values 13 (carriage return) and 10 (linefeed). If you want to display numeric values, you'll have to convert the number to a series of ASCII values. E.g., to display the number 123, you could send the values 49, 50, 51. It's easiest to display the number in hexadecimal, because you can easily isolate each digit with shift and add instructions.
  2. Receive and display the sent characters on another device. This other device could be a virtual serial console (with ase100) or another computer.

For more information, see Lab 7's handout on serial communication