| |
Datasheet Home \ Datasheet Details
Download
PDF Abstract Text:
Order this document by AN1287 / D
AN1287
Freescale Semiconductor
Order this document by AN1287 / D
AN1287
Freescale Semiconductor, Inc..
MC68HC708LN56 LCD Utilities
By Rick Cramer CSIC Product Engineering Austin, Texas
Introduction
A set of software utilities that causes the LCD module on the MC68HC708LN56 to function is described in this application note. Information about LCD software subroutines that, with minimal effort, can be called to write text to the display also is included here. Additionally, this information can be used as a basis to develop more complex graphical subroutines.
LCD Hardware General Information
The LCD module has of group of frontplanes and backplanes that intersect on the display to form pixels. The 40 frontplanes and 32 backplanes form 40 x 32 (or 1280) pixels. By implementing the LCD hardware in different configurations, these pixels can be arranged to form any type of display. When the hardware is arranged in a twodimensional array, the pixels form a display of 40 x 32 dots. By turning on these pixels in a specific pattern, alphabet characters or special symbols can be formed. All the characters on a typical computer keyboard can be displayed by an array of pixels seven pixels high by five pixels wide, which enables the MC68HC708LN56 to display an 8 x 4
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note
Freescale Semiconductor, Inc..
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note LCD Hardware General Information
Data Plane Address
BP0 Bit 0
Freescale Semiconductor, Inc..
BP1 Bit 1 BP2 Bit 2 BP3 Bit 3 BP4 Bit 4 BP5 Bit 5 BP6 Bit 6
Figure 2. LCD Character Representation
FP4 FP0
BP0 BP8 BP0-31 BP24 BP31
Figure 3. LCD Panel Dot Matrix Example
AN1287 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note
Subroutine Descriptions
Freescale Semiconductor, Inc..
General Description
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Subroutine Descriptions
Freescale Semiconductor, Inc..
The main code section is designed as an example of what is needed to enable the LCD and to call the subroutines. The main code clears the display, writes text to the screen, then loops through memory, updating only sections of the screen and displaying the current address and the data contained at that address. The loop repeats after cycling through memory. The RAM subroutines are designed to be called by other subroutines. They are modified by the calling subroutine before they are called. The RAM subroutines contain this assembled data:
RAM Subroutines
NOTE:
Care must be taken not to overwrite the two opcodes, LDA and RTS. If these locations are accidentally changed, the MCU could get hopelessly lost executing code that is invalid.
AN1287 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note
AN1287
Freescale Semiconductor, Inc..
BINTOASC
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Subroutine Descriptions
Freescale Semiconductor, Inc..
AN1287 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note
WRITEIT2
Freescale Semiconductor, Inc..
Tables
LCDLOC
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Tables
LCDBACK
CHARROM
Freescale Semiconductor, Inc..
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note Code Listings
Code Listings
Freescale Semiconductor, Inc..
RESET and Interrupt Vectors For any interrupts used, the ORG and FDB statement given below must be placed in the routine using the interrupt. org RESET fdb BEGIN
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Code Listings
Freescale Semiconductor, Inc..
Current Position in String Space for controller generated
Freescale Semiconductor, Inc. Application Note
Code Listings
lda sta lda sta
Store A Extended Opcode RTS OpCode
Freescale Semiconductor, Inc..
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Code Listings
Freescale Semiconductor, Inc..
AN1287 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note
Code Listings
Freescale Semiconductor, Inc..
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Code Listings
Freescale Semiconductor, Inc..
AN1287 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note
Code Listings
Freescale Semiconductor, Inc..
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Code Listings
Freescale Semiconductor, Inc..
AN1287 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note
Code Listings
find first data byte of lda HI+1 add OFFSET+1 sta OFFSET+1 lda HI adc OFFSET sta OFFSET ldhx OFFSET sthx HI clrh clrx
the current char to write Get base address of char rom Add the offset To find the first data byte of single character to write
Freescale Semiconductor, Inc..
BYTE 3
BYTE 4
BYTE 5
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Code Listings
WriteIt2 subroutine takes beginning data byte and the next four and writes it onto the LCD screen, but it does it backward. WRITEIT2 jsr jsr jsr jsr INLOC2 INLOC2 INLOC2 INLOC2 OPCD INVERT OPCD3 INLOC DECLOC2 OPCD INVERT OPCD3 INLOC DECLOC2 OPCD INVERT OPCD3 INLOC DECLOC2 OPCD INVERT OPCD3 INLOC DECLOC2 OPCD INVERT OPCD3 increment 4 positions in the character table beacuse it will be writen backward
Freescale Semiconductor, Inc..
jsr eor jsr jsr jsr jsr eor jsr jsr jsr jsr eor jsr jsr jsr jsr eor jsr jsr jsr jsr eor jsr RTS
BYTE 3
BYTE 4
BYTE 5
AN1287 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note
Code Listings
Freescale Semiconductor, Inc..
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Code Listings
FDB FDB FDB FDB FDB FDB FDB FDB FDB FDB FDB FDB FDB FDB FDB FDB
Pos Pos Pos Pos Pos Pos Pos Pos Pos Pos Pos Pos Pos Pos Pos Pos
Freescale Semiconductor, Inc..
AN1287 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note
Code Listings
Freescale Semiconductor, Inc..
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Code Listings
FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB AN1287
Freescale Semiconductor, Inc..
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note
Code Listings
FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB FCB
Freescale Semiconductor, Inc..
~ y (Batwing) (Batwing) (Batwing) (Batwing) (Batwing) (Batwing) M -TOP M -BOT O O T T R R AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Code Listings
FCB FCB FCB FCB ENDLOC:
Freescale Semiconductor, Inc..
AN1287 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note Flow Chart
Flow Chart
BEGIN
Freescale Semiconductor, Inc..
TURN OFF COP
CLEAR VARIABLES
INITIALIZE VARR LOOP
SETUP RAM SUBROUTINE
WRITE DATA TO DISPLAY
CLEAR DISPLAY INCREMENT VARR LOOP TURN LCD ON
WRITE INITIAL DISPLAY TEXT
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Flow Chart
BINTOASC SUBROUTINE
STORE DATA IN RAM BUFFER MSG
STORE DATA AND LOCATION IN RAM
Freescale Semiconductor, Inc..
STORE DELIMITER CHARACTER IN RAM MESSAGE BUFFER (MSG+1)
CONVERT LOWER NIBBLE OF DATA FROM BINARY TO ASCII
STORE LOWER NIBBLE IN RAM BUFFER (MSG+1)
CONVERT UPPER NIBBLE OF DATA FROM BINARY TO ASCII
STORE DELIMITER CHARACTER IN RAM MESSAGE BUFFER (MSG+2)
STORE UPPER NIBBLE TO RAM (MSG)
AN1287 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note
Flow Chart
STORE DATA AND LOCATION IN RAM
CLEAR POINTER
STRPOS
Freescale Semiconductor, Inc..
COPY STRING POINTER TO RAM SUBROUTINE
CHANGE RAM SUBROUTINE FOR INDEXED ADDRESSING
GET CHARACTER FROM STRING
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Flow Chart
CLS SUBROUTINE
CLEAR X REGISTER
Freescale Semiconductor, Inc..
CLEAR LCD BANK1, X
CLEAR LCD BANK2, X
CLEAR LCD BANK4, X
CLEAR LCD BANK3, X
INCREMENT X REGISTER
AN1287 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note
Flow Chart
INV SUBROUTINE
CLEAR X REGISTER
Freescale Semiconductor, Inc..
COMPLIMENT LCD BANK1, X
COMPLIMENT LCD BANK2, X
COMPLIMENT LCD BANK4, X
COMPLIMENT LCD BANK3, X
INCREMENT X REGISTER
AN1287
For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc.
Application Note Flow Chart
WRITE POSITION SUBROUTINE
STORE DATA AND LOCATION IN RAM GET BACKWARD DATA FROM TABLE
SETUP RAM SUBROUTINE FOR EXTENDED ADDRESSING
Freescale Semiconductor, Inc..
STORE BACKWARD DATA IN "BACK" LOOKUP LCD MEMORY LOCATION IN TABLE
STORE LCD LOCATION IN RAM SUBROUTINE
AN1287 For More Information On This Product, Go to: www.freescale.com
Freescale Semiconductor, Inc. Application Note R E Q U I R E D
How to Reach Us:
Home Page: www.freescale.com E-mail: support@freescale.com USA / Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, CH370 1300 N. Alma School Road Chandler, Arizona 85224 +1-800-521-6274 or +1-480-768-2130 support@freescale.com Europe, Middle East, and Africa: Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen, Germany +44 1296 380 456 (English) +46 8 52200080 (English) +49 89 92103 559 (German) +33 1 69 35 48 48 (French) support@freescale.com Japan: Freescale Semiconductor Japan Ltd. Headquarters ARCO Tower 15F 1-8-1, Shimo-Meguro, Meguro-ku, Tokyo 153-0064 Japan 0120 191014 or +81 3 5437 9125 support.japan@freescale.com Asia / Pacific: Freescale Semiconductor Hong Kong Ltd. Technical Information Center 2 Dai King Street Tai Po Industrial Estate Tai Po, N.T., Hong Kong +800 2666 8080 support.asia@freescale.com For Literature Requests Only: Freescale Semiconductor Literature Distribution Center P.O. Box 5405 Denver, Colorado 80217 1-800-441-2447 or 303-675-2140 Fax: 303-675-2150 LDCForFreescaleSemiconductor@hibbertgroup.com
Freescale Semiconductor, Inc..
For More Information On This Product, Go to: www.freescale.com
|