4.3" PSP LCD
The design consists of the following building blocks:
- Sync generator
- Display memory
- Font tablev
- Color output generator
Sync generatorThe 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 memoryThe 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:
0×000 is the first character on the top left screen. After that it moves from left to right, top to bottom. Line 2 starts at 0×040, line 3 at 0×080 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 tableThe font that is used is the 16×8 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 outputThe 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:
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
ResultAnd the 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 picturesBelow 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).
DownloadYou 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
Comments are closed