Site Index
   Home
   File Upload
Google

Transfer Site
Main Site

EVM5502 LCD Module

This module displays characters on the LCD screen on the EVM5502’s keypad/display. The LCD is organized as an array 128 pixels wide and 64 pixels tall. Each 8-bits chunk of data written to the display represents an 8-bit vertical slice, so you can think of the raw display organization of 128 columns of eight 8-bit tall rows.

The BSL contains a character set for the viewable ASCII characters (ASCII 32 – ASCII 127). You can modify the character set by re-compiling the LCD module. Each character is defined as a matrix of monochrome pixels 6 pixels wide and 8 pixels tall. The character data is packed in 16-bit data words with the first vertical slice in the most significant byte of the first word, the second vertical slize in the LSB of the first word, the third vertical slice in the BSM of the second word, etc.

The text commands use device coordinates based on characters (0 – 20 horizontal, 0 – 7 vertical). The raw data commands use raw coordinates to give flexibility (0-127 horizontal, 0-7 vertical).

The display maintains an invisible cursor where the next piece of display data will appear. The LCD module functions output text and graphics at the current position with alternative forms of the commands available to set the position beforehand (these have the postfix Pos appended such as EVM5502_LCD_textPos() ).

Function Description
EVM5502_LCD_init Initialize the LCDs
EVM5502_LCD_rset Sends commands and data to the LCD controller
EVM5502_LCD_setPos Set the current cursor position
EVM5502_LCD_char Display a character at the current position
EVM5502_LCD_raw Display raw graphics data at the current position
EVM5502_LCD_rawPos Display raw graphics data at a fixed position
EVM5502_LCD_text Display a text string at the current position
EVM5502_LCD_textPos Display a text string at a fixed position
EVM5502_LCD_hex Display a 16-bit hex number at the current position
EVM5502_LCD_hexPos Display a 16-bit hex number at a fixed position
EVM5502_LCD_fillScreen Fill the screen with a fixed value

EVM5502_LCD_init()

Description
Initializes the LCD module, must be first LCD module function called.

Required Headers
evm5502.h
evm5502_lcd.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_LCD_init( )

Parameters
None

Return Value
None

Example

    /* Initialize the LCD module */
    EVM5502_LCD_init( );

EVM5502_LCD_rset()

Description
Sends commands and data to the LCD controller.

Required Headers
evm5502.h
evm5502_lcd.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_LCD_rset(Int16 a0, Uint16 data)

Parameters
a0 – the state of the LCD controller’s A0 line when the data is sent. When a0 = 0, the data will be interpreted as a command. When a0 = 1, the data will be interpreted as display data.
data – the data to be sent to the LCD. Only the lower 8-bits are used.

Return Value
None

Example

    /* Send a byte of raw display data
     * (0xA5) to the screen */
    EVM5502_LCD_rset(1, 0xA5);

EVM5502_LCD_setPos()

Description
Set the current cursor position. The next byte of display data sent to the LCD will appear here.

Required Headers
evm5502.h
evm5502_lcd.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_LCD_setPos(Int16 x, Int16 y)

Parameters
x – horizontal position in raw device coordinates (0 – 127)
y – vertical position in raw device coordinates (0 – 7)

Return Value
None

Example

    /* Set the cursor position to 
     * the middle of the top row */
    EVM5502_LCD_setPos(63, 0);

EVM5502_LCD_char()

Description
Display a character at the current position.

Required Headers
evm5502.h
evm5502_lcd.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_LCD_char(Int16 ch)

Parameters
ch – ASCII index of character to display (32 – 127)

Return Value
None

Example

    /* Draw an ‘A’ at the current position */
    EVM5502_LCD_char(‘A’);

EVM5502_LCD_raw()

Description
Display raw graphics data at the current position.

Required Headers
evm5502.h
evm5502_lcd.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_LCD_raw(Uint16 *pdata, Int16 len)

Parameters
pdata – pointer to display data
len – number of bytes to display

Return Value
None

Example

    /* Display a circle at the current position */
    Uint16 circle[] = {0x1c22, 0x4141, 0x4122, 0x1c00}
    EVM5502_LCD_raw(circle, 8);

EVM5502_LCD_rawPos()

Description
Display raw graphics data at a fixed position.

Required Headers
evm5502.h
evm5502_lcd.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_LCD_rawPos(Int16x, Int16y, Uint16 *pdata, Int16 len)

Parameters
x – horizontal position in raw device coordinates (0 – 127)
y – vertical position in raw device coordinates (0 – 7)
pdata – pointer to display data
len – number of bytes to display

Return Value
None

Example

    /* Display a circle in the upper left corner */
    Uint16 circle[] = {0x1c22, 0x4141, 0x4122, 0x1c00}
    EVM5502_LCD_rawPos(0, 0, circle, 8);

EVM5502_LCD_text()

Description
Display a text string at the current position.

Required Headers
evm5502.h
evm5502_lcd.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_LCD_text(char *str)

Parameters
str – zero terminated character string to display

Return Value
None

Example

    /* Display the message "Hello" */
    EVM5502_LCD_text("Hello");

EVM5502_LCD_textPos()

Description
Display a text string at a fixed position.

Required Headers
evm5502.h
evm5502_lcd.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_LCD_textPos(Int16 x, Int16 y, char *str)

Parameters
x – horizontal position in text coordinates (0 – 20)
y – vertical position in text coordinates (0 – 7)
str– zero terminated character string to display

Return Value
None

Example

    /* Display the message "Hello" 
     * in the middle of the top row */
    EVM5502_LCD_textPos(8, 0, "Hello");

EVM5502_LCD_hex()

Description
Display a 16-bit hex number at the current position.

Required Headers
evm5502.h
evm5502_lcd.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_LCD_hex(Uint16 hexnum)

Parameters
hexnum – value to display

Return Value
None

Example

    /* Display the hex number 0xABCD
     * at the current position */
    EVM5502_LCD_hex(0xABCD);

EVM5502_LCD_hexPos()

Description
Display a 16-bit hex number at a fixed position.

Required Headers
evm5502.h
evm5502_lcd.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_LCD_hexPos(Int16 x, Int16 y, Uint16 hexnum)

Parameters
x – horizontal position in text coordinates (0 – 20)
y – vertical position in text coordinates (0 – 7)
hexnum – value to display.

Return Value
None

Example

    /* Display the hex number 0xABCD
     * in the middle of the top line */
    EVM5502_LCD_hexPos(8, 0, 0xABCD);

EVM5502_LCD_fillScreen()

Description
Fill the screen with a fixed value.

Required Headers
evm5502.h
evm5502_lcd.h

Required Libraries
evm5502bsl.lib

Function Prototype
void EVM5502_LCD_fillScreen(Int16 value)

Parameters
value – value to fill screen with. Only lower 8-bits are used

Return Value
None

Example

    /* Clear the screen */
    EVM5502_LCD_fillScreen(0);
©Copyright 2002-2011 Spectrum Digital, Inc. All Rights Reserved.