4.3" PSP LCD

By xantus on Sunday 7 February 2010 15:09
Category: Verilog examples, Views: 2.639

Although the Cyclone EP1C6 does not contain enough ram bits to display graphics on this huge display. It can be used as a large character display, with the capabilities to display up to 1.620 characters (2760) with a 8x16 font.

Schematic overview

Schematic

The design consists of the following building blocks:
  • Sync generator
  • Display memory
  • Font tablev
  • Color output generator

Implementation

Sync generator
The sync generator generates de horizontal en vertical sync signals as described in vga timing. It also generates the address for the display memory. In the design it consists of de modules h_sync, v_sync, in_picture and char_addr.
Display memory
The display memory is DP RAM1) (rom in the provided design) which permits simultaneous reading and writing. The display memory has space for 60 characters per line, 27 lines deep. It has the following layout:

offset00010203040380390x3A0x3B0x3C
0000char[0]char[1]char[2]char[3]char[4]
0040char[0]char[1]char[2]char[3]char[4]
0080char[0]char[1]char[2]char[3]
0x0C0char[0]char[1]char[2]
0100char[0]char[1]
0140char[0]
0180
0x1C0
0500
0540
0580char[63]
0x5C0char[62]char[63]
0600char[61]char[62]char[63]
0640char[60]char[61]char[62]char[63]
0680char[59]char[60]char[61]char[62]char[63]
0x6C0char[59]char[60]char[61]char[62]char[63]


0000 is the first character on the top left screen. After that it moves from left to right, top to bottom. Line 2 starts at 0040, line 3 at 0080 etc. The last line (27) starts at 0x6C0. Characters 60, 61, 62 and 63 of each line are not displayed. Also lines 28 to 31 are not displayed (these are also not displayed in the above memory map).

The usage is simple. Just write the ASCII code (or address in the font table) of the character to the correct location to display it.
Font table
The font that is used is the 168 font which was originally used by IBM. It is stored in a .mif2) file so that it can be easy changed by other fonts. See here for more info: IBM font.
Color output
The color of the output is determined in the color module. It is capable of generating 256 (8-bit) different color. It currently is set to white foreground with a blue background. The foreground and background colors can be set in:

C: color_settings
1
2
3
4
5
6
7
8
9
10
11
12
13
if (q[cnt])
   begin // foreground color here
    red <= 3'b111;
    green <= 3'b111;
    blue <= 2'b11;
   end
  else
   begin // background color here
    red <= 3'b000;
    green <= 3'b000;
    blue <= 2'b11;
   end
 end

Result

And the result 8-) :

Result

It uses 79 LE's in a Cyclone EP1C6. It also uses 48 kB (53%) of the ram bits with a 256 char font table and 2048 (1620 visible) character display memory. With a smaller font table (64 char) it will use 14 kB (15%) of the available ram bits.
User pictures
Below are some pictures from another blue bird user. His website can be found here: http://users.skynet.be/fotoopa/ (Blue bird FPGA stuff here http://users.skynet.be/fotoopa/fpga/fpga.htm).

http://users.skynet.be/fotoopa/fpga/FV1_5418.jpg

http://users.skynet.be/fotoopa/fpga/FV1_5429.jpg
Download
You can download the project here: lcd.qar (321 kB)
Note that the code does not contain any comments and the clock generator is used written for a 50MHz clock.

1) Dual Port RAM
2) Memory Initialization File
http://www.greenbird.info/img.php?h&b=43-inch-psp-lcd&f

Volgende: SRAM controller 02-'10 SRAM controller
Volgende: VGA 02-'10 VGA

Comments

Comments are closed