Docsity

LCD Display Flash ROM - Computer Design Lab | CS 3710, Study notes of Computer Science

Toggle sidebar
bg1
1
Other I/O
LCD display
Flash ROM
Keyboard (PS/2)
UART connectors
LCD Display
2-line, 16 character LCD display
4-bit interface
Relatively easy to use once you have it mapped
into your processor’s memory-mapped I/O
Send characters to it, they show up on the screen
Not fast!
zScrolling at half-second intervals is about as fast as
you can go and still have a clear display
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download LCD Display Flash ROM - Computer Design Lab | CS 3710 and more Study notes Computer Science in PDF only on Docsity!

Other I/O

LCD display

Flash ROM

Keyboard (PS/2)

UART connectors

LCD Display

Š 2-line, 16 character LCD display

„ 4-bit interface „ Relatively easy to use once you have it mapped into your processor’s memory-mapped I/O „ Send characters to it, they show up on the screen „ Not fast! z Scrolling at half-second intervals is about as fast as you can go and still have a clear display

LCD

LCD Control

DD RAM

Š DD RAM – memory to hold the characters

being displayed

„ Data written to each of these locations is the 8-bit address of a character in the CG ROM/RAM

CG ROM/RAM

Š For example,

8’h53 = S

„ Note the Japanese kana characters…

Š Also, notice the

8 CG RAM

locations

„ Addresses 8’h00 to 8’h

CG RAM

Š This example is custom character 0’h

„ Note that there are 8 rows in custom character 3 „ So, it takes 8 writes to make a custom character „ Row address is incremented automatically…

Operation Overview

Š Pick an LCD screen location

„ Write an 8-bit character address to that location „ Then it shows up on the screen

Š Pick a CG RAM location

„ Write 8 bytes starting at that location „ Now you can use that new custom character

Š Do it all with just a four-bit interface…

„ Lots of little nibble writes….

Command Set

Command Set

Š Commands are sent upper-nibble first

Write Timing

Memory Mapped I/O

Š So, as a practical matter, the easiest way to

deal with the LCD is to map the interface to a

memory-mapped location

„ Now you can, under program control, change the values on the data and control wires

Your Processor en

I/O Reg

Writing to the address of the LCD Reg will update its value

Using the Display

Remember timing!

Š The LCD_E enable pulse must be high for at

least 230ns (12 clock cycles at 50MHz)

Š The two nibbles must be separated by 1μs

(50 cycles)

Š Two different commands must be separated

by 40μs (2000 cycles)

„ But, these are easily done in an assembly language program… (as are the even longer configuration delays)

Strata Flash

Š 16 MByte

(8 Mword) flash

ROM

„ Designed to hold configuration data for the Spartan part „ But, can be used for general non-volatile data

Strata Flash

Š Some data lines are

shared with the

LCD

„ But, if you don’t read back from the LCD they can both work together

Reading from the Flash

Š Not as tricky

„ But, the flash has a 75ns access time „ So, it will take four 50MHz cycles to read data z Each cycle is 20ns „ Set SF_oe and SF_ce active (low) and wait for four cycles (80ns) before grabbing return data… „ As usual map the flash into your processor’s memory-mapped address space

Xilinx Example

Xilinx

Example

PS/2 Keyboard Interface

Š Standard keyboard interface

„ Serial protocol similar to UART, but with its own clock „ When you press a key, the keyboard sends a “make code” (one, sometimes two, bytes) „ When you release the key, the keyboard sends a “break code” (two, sometimes three, bytes) „ Collectively, these are known as “scan codes”

Scan Codes

ASCII codes

PS/2 Things to Keep in Mind

„ When you press and hold a key, the make code is sent every 100ms or so „ If no key is pressed, both clk and data are in their idle state „ Probably want a PS/2 controller that grabs codes and puts them in a register that can be read by your program (memory mapped I/O) „ Probably want to set a bit that says “new code” that gets cleared when the code is read

PS/2 Mouse

Whenever the mouse moves it Sends three bytes.

Status tells you state of buttons sign of X and Y, and overflow for X and Y

UART Basics

UART Basics

Use rcv-req as a flag to be read by your program? Assert xmt-req by your program to initiate send?

50MHz clock

Summary

Š All I/O can be mapped into your memory space „ You have lots of room left over in the addressable space if you use block RAMs only

Š Control the devices under program control „ Some memory locations will be data, some will be control „ Writing or reading these locations will have I/O side effects

Š Think about how your program will interact with I/O

Memory Map

I/O Switches/LEDs UART

Code/Data

Flash ROM?

Code/Data 0000

3FFF

4000

7FFF

8000

BFFF

C

FFFF

16k words (32k bytes)

Top two address bits define regions?

Word addresses

4k additional words

Block RAM

Frame buffer?

Glyphs?