Altera DE2 Project lcdlab3

Download: design files

This project displays the value of SW[7:0] as two digits in the LCD.

Contents

The LCD displays 16 Characters on 2 lines. The LCD_display string is an ASCII character string entered in hex for the two lines of the LCD Display. (See ASCII to hex table below) Edit the LCD_Display_String entries to modify display. Enter the ASCII character's 2 hex digit equivalent value (see table below for ASCII hex values) To display character assign ASCII value to LCD_display_string(x) To skip a character use 8'h20 (ASCII space) To dislay "live" hex values from hardware on LCD use the following:

  1. Make array element for that character location 4'h0 & 4-bit field from Hex_Display_Data. >The state machine sees 4'h0 in high 4-bits & grabs the next lower 4-bits from Hex_Display_Data input and performs 4-bit binary to ASCII conversion needed to print a hex digit
  2. Num_Hex_Digits must be set to the count of hex data characters (ie. "00"s) in the display
  3. Connect hardware bits to display to Hex_Display_Data input

To display fewer than 32 characters, terminate string with an entry of 8'hFE (fewer characters may slightly increase the LCD's data update rate)

-----------------------------------------------------------------
                       ASCII HEX TABLE
 Hex                        Low Hex Digit
Value  0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
------\----------------------------------------------------------------
 H  2 |  SP  !   "   #   $   %   &   '   (   )   *   +   ,   -   .   /
 i  3 |  0   1   2   3   4   5   6   7   8   9   :   ;   <   =   >   ?
 g  4 |  @   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O
 h  5 |  P   Q   R   S   T   U   V   W   X   Y   Z   [   \   ]   ^   _
    6 |  `   a   b   c   d   e   f   g   h   i   j   k   l   m   n   o
    7 |  p   q   r   s   t   u   v   w   x   y   z   {   |   }   ~ DEL
-----------------------------------------------------------------------
Example "A" is row 4 column 1, so hex value is 8'h41
*see LCD Controller's Datasheet for other graphics characters available 

Reference

Verilog source and Quartus compilation report


Maintained by John Loomis, last updated 23 January 2008