This note describesatechnique for drivingaLiquid Crystal Display (LCD) withastandard ST62
microcontroller (MCU), without any dedicated LCD driver. This technique offersadisplay capability for applications which require a small display atalow cost together with the versatile capabilities of the standard ST62xx MCU. Higher display requirements are easily handled by
dedicated members of the ST62 MCU family, for example the ST6240B.
The first part of this note describes the typical waveforms required to drive an LCD correctly
withamultiplexing rate of1or2(duplex). The following parts present two solutions based on
standard ST62 MCUs driving directly the LCD. The first is based on an ST6215 without using
software interrupts and the second on an ST6265 where the LCD is controlled by timer interrupts.
In both examples the program size, the CPUtime occupation due to the LCD drive and the number
of surrounding components are minimized. Consequently many additional tasks can be added to
the MCU program.
LCD requirements
Withazero Root Mean Square (RMS) voltage applied to it, an LCD is practically transparent.
The LCD contrast, which makes the segments turn dark or opaque and thus “on”, is caused by
the difference between the RMS LCD voltage applied and the LCD threshold voltage, specific
to each LCD type.
The applied LCD voltage must alternate to giveazero DC value in order to ensurealong life
the LCD. The higher the multiplexing rate is, the lower the contrast, also the period of
time of
the signal has to be short enough to avoid visible flickering of the LCD display. The LCD voltage for each segment equals to the difference between theSand COM voltages (see Figure
1).
Figure 1. Equivalent electrical schematic
of an LCD segment
October 2008 Rev 2
DC value should never be more than
-
100mV. Else time life can be shorten.
Frequency range is 30-2000Hz typically.
-
Less, it flickers; more, consumption
grows.
1/28
Direct LCD Drive
Direct LCD drive
Each LCD segment is connected to an I/O “Segment” and to one backplane common to all the
segments. A display using S segments is driven with S+1 MCU output lines. The backplane is
driven with a signal “COM” controlled between 0 and V
with a duty cycle of 50%.
DD
When selecting a segment “ON”, a signal with opposite polarity to “COM” is sent to the corresponding “Segment” pin. When the non-inverted signal “COM” is sent to the “Segment” pin, the
segment is “OFF”. Using an MCU the I/O operate in output mode either at the logic levels 0 or
1.
Figure 2. LCD signals for direct drive
2/28
Duplexed LCD drive
For duplexed drive, two backplanes are used
instead of one. Each LCD pin is connected to
two LCD segments, each one connected on
the other side to one of the two backplanes.
Thus, only (S/2)+2 MCU pins are necessary
to drive an LCD with S segments.
Three different voltage levels have to be generated on the backplanes : 0, V
/2 and VDD.
DD
The “Segment” voltage levels are 0 and Vdd
only. The LCD segment is inactive if the RMS
voltage is below the LCD threshold voltage
and is active if the LCD RMS voltage is
above the threshold voltage. Figure 4 shows
typical Backplane, Segment and LCD waveforms.
The intermediate voltage V
/2 is only re-
DD
quired for the “Backplane” voltages. The
ST62 I/O pins selected as “Backplanes” are
set by software to output mode for 0 or Vdd
levels and to high impedance input mode for
V
/2. This voltage Vdd/2 is defined by two
DD
equal valued resistors externally connected
to the I/O pin.
By using an MCU with flexible I/O pin configuration such as the ST6215x or ST6265x,
duplexed LCD drive can be made with only 4
additional resistors.
Direct LCD Drive
Figure 3. Basic LCD segment connection in duplexed mode
3/28
Direct LCD Drive
Figure 4. LCD signals for duplexed mode (used in ST6215 example)
4/28
Direct LCD Drive
Example of duplexed LCD drive with ST6215x
The following example describes the drive in duplexed mode of an LCD with an ST6215. The
software is made in such way that no interrupt is generated and an OFF state for the LCD is
possible. The only components necessary are those to drive the ST62 (oscillator, reset,...) and
four resistors to generate the backplane intermediate voltages.
The ST6215 has 20 I/O pins, thus it is able to drive up to 36 LCD segments and 2 backplanes.
One digit is defined with 8 segments connected to 2 backplanes. Each digit can display 11 values, from 0 to 9 and no display.
Each value to be displayed is associated to a certain LCD waveform. One LCD waveform period is separated in 4 steps corresponding to the 3 I/O configurations (1-0-input). A look-up table stores the bytes which relate the I/O configuration to the value to display.
Figure 5. ST6215 based example
5/28
Direct LCD Drive
The following tables show an example of linking one LCD digit of the display with the relevant MCU port se
quences. The second digit follows the same scheme. These examples are for the sample LCD display,
please adapt these tables to your particular LCD.
The digit segments are connected to PB0-PB3 lines in this example. Schematic is shown in Figure 5.
Each digit configuration definesasegment status. Each couple of segments defines a timing sequence to
be output by MCU “Segment” lines (see Figure 4). These sequences are coded inside the ST6215.
Table 1: Example of drive ofadigit with ST6215
Digit Segments to DisplaySegment Connections
Digit
Required
Digit
Required
a
fb
g
e
c
d
Segments
COM1 ON ON ON ON
COM2 OFF ON OFF ON
T100000h
T201015h
T31010Ah
T41111Fh
COM1 OFF OFF OFF OFF
COM2 OFF ON OFF ON
T11111Fh
T210105h
T30101Ah
T400000h
Status
Timing Sequences
Timing Sequences
Segment LinePB3PB2PB1PB0
COM1 (PA6)defa
COM2 (PA7)OFFcgb
Segments
Status
MCU
Output
Sequences
MCU
Output
Sequences
Digit
Required
Blank
Digit
Required
Segments
COM1 OFF OFF OFF OFF
COM2 OFF OFF OFF OFF
Timing Sequences
T11111Fh
T200000h
T31111Fh
T400000h
COM1 OFF OFF ON OFF
COM2 OFF ON ON ON
Timing Sequences
T11101Dh
T201117h
T310008h
T400102h
Status
Segments
Status
MCU
Output
Sequences
MCU
Output
Sequences
-
6/28
Digit
Required
Digit
Required
Segments
COM1 ON ON OFF ON
COM2 OFF OFF ON ON
Timing Sequences
T100102h
T200113h
T31100Ch
T41101Dh
COM1 ON OFF OFF ON
COM2 OFF ON ON ON
Timing Sequences
T101106h
T201117h
T310008h
T410019h
Status
Segments
Status
MCU
Output
Sequences
MCU
Output
Sequences
Digit
Required
Digit
Required
Segments
COM1 ON OFF ON ON
COM2 OFF ON ON OFF
Timing Sequences
T101004h
T201106h
T310019h
T41011Bh
COM1 ON ON ON ON
COM2 OFF ON ON OFF
Timing Sequences
T100000h
T201106h
T310019h
T41111Fh
Status
Segments
Status
MCU
Output
Sequences
MCU
Output
Sequences
Direct LCD Drive
Digit
Required
Digit
Required
Segments
COM1 OFF OFF OFF ON
COM2 OFF ON OFF ON
T1 1110 Eh
T2 0101 5h
T3 1010 Ah
T4 0001 1h
COM1 ON ON ON ON
COM2 OFF ON ON ON
T1 0000 0h
T2 0111 7h
T3 1000 8h
T4 1111 Fh
Status
Timing Sequences
Segments
Status
Timing Sequences
MCU
Output
Sequences
MCU
Output
Sequences
Digit
Required
Segments
COM1 ON OFF ON ON
COM2 OFF ON ON ON
Timing Sequences
T1 0100 4h
T2 0111 7h
T3 1000 8h
T4 1011 Bh
Status
MCU
Output
Sequences
7/28
Direct LCD Drive
Example of duplexed LCD drive with ST6265x
In this example the LCD drive tasks are controlled by interrupts from an on-chip timer. This software block can be easily included in a central task such as motor control, temperature measurement or heating. Figure 6 shows the circuit of the application. Only 4 resistors are added to drive
the LCD in the duplexed mode.
Figure 6. ST6265x based example
8/28
Direct LCD Drive
The software for the LCD display operates in interrupt mode, driving I/O pins by the CPU at instants defined by the Timer1 interrupts. When the LCD drive tasks are finished, the main application program can continue.
The major tasks of the LCD display routine are:
generation of the alternate signals which control the backplanes (PB0, PB1)
-
drive of the LCD segments through PortA
-
conversion of the hexadecimal data to decimal data
-
program Timer1 for the next drive sequence
-
The backplane pattern sequences are different between ST6215x and ST6265x examples.
The ST6215x software is based on non-symetrical signals (see Figure 4). The backplane patterns are symetrical in the ST6265x software. Both are equivalent on the LCD viewpoint.
The ROM code size used is 300 bytes for the program and 256 bytes for the tables. With an
CPU frequency of 8MHz, the display task duration is 240μs and the full task duration including
decimal conversion is 510μs. With an LCD period signal of 14ms, the CPU duty cycle of occupation is 2.5% for the LCD drive task. The program can be adjusted to other applications by
modifying the timer duration (FASTIM) and the segment drive byte table. The LCD drive phase
may also be synchronized to the mains zero crossing or a software loop duration, saving the
timer for other tasks.
Summary
The examples presented in this note show that a simple LCD can be driven directly by standard
ST621x/2x/6x/9x microcontrollers. The ST62’s flexible I/O configuration and the large voltage
range of operation of the ST62 family MCU allow an LCD driver to be achieved with very few
surrounding components, small CPU time occupation and reduced ROM program size.
Such an approach is a very cost effective solution for simple LCD displays operating with a
multiplexing rate of 1 or 2 and up to 36 segments. For LCDs requiring more segment drive capability and/or higher multiplexing rates ST624x and ST628x provide highly integrated and
easy to implement solutions.
Such LCD drive features can easily be included in a larger application including keyboard interface, sensor display or motor control.
We thank the company Akotronic for the ST6215x application example they have developed
for this note.
Annex 1: Software of the ST6215x based application
Annex 2: Flowchart and software of the ST6265x based application
9/28
Direct LCD Drive
ANNEX 1: Software of the ST6215x based application
;***************************************************************************
;*DEMONSTRATION SOFTWARE FOR MANAGEMENT OF A BIPLEXED LIQUID CRISTAL
;*DISPLAY ( LCD ) WITH ST621X OR ST622X SGS THOMSON MICROCONTROLLERS
;***************************************************************************
;*This program has been developped by AKOTRONIC comp.
;*PARC DE LA MOTHE 03400 YZEURE FRANCE
.ROMSIZE 4 .
VERS “ST6225"
; SWD, 4MHZ
x .DEF 80h!m; INDEX REGISTER
Y .DEF 81h!m; INDEX REGISTER
V .DEF 82h; SHORT DIRECT REGISTER
W .DEF 83h; SHORT DIRECT REGISTER
A .DEF 0FFh!m ; ACCUMULATOR
DRA.DEF 0C0h ; PORT A DATA REGISTER
DRB.DEF 0C1h ; PORT B DATA REGISTER
DRC.DEF 0C2h ; PORT C DATA REGISTER
DDRA .DEF 0C4h ; PORT A DIRECTION REGISTER
DDRB .DEF 0C5h ; PORT B DIRECTION REGISTER
DDRC .DEF 0C6h ; PORT C DIRECTION REGISTER
IOR.DEF 0C8h ; INTERRUPT OPTION REGISTER
DWR.DEF 0C9h ; DATA ROM WINDOW REGISTER
ORA.DEF 0CCh ; PORT A OPTION REGISTER
ORB.DEF 0CDh ; PORT B OPTION REGISTER
ORC.DEF 0CEh ; PORT C OPTION REGISTER
ADR.DEF 0D0h ; A/D DATA REGISTER
ADCR .DEF 0D1h ; A/D CONTROL REGISTER
PSC.DEF 0D2h ; TIMER PRESCALER REGISTER
TCR.DEF 0D3h ; TIMER COUNTER REGISTER
TSCR .DEF 0D4h ; TIMER STATUS CONTROL REGISTER
TOUCHU .DEF 084h;Low Significant DIGIT button ( L.S. DIGIT )
TOUCHD .DEF 085h;More significant DIGIT button ( M.S. DIGIT )
TOUCH .DEF 086h;pushed button
COPYA .DEF 087h;COPY of PORT A
COPYB .DEF 088h;COPY of PORT B
COPYC .DEF 089h;COPY of PORT C
TABD.DEF 08Ah;data/ROM window address to display M.S. DIGIT
TABU.DEF 08Bh;data/ROM window address to display L.S. DIGIT
LOOP.DEF 08Ch;LOOP
;*END OF INITIALIZATION SUBROUTINE
;**************************************************************************
;**************************************************************************
;*MAIN LCD DRIVE SUBROUTINE
;*
;* task : generate alternative signals to control LCD backplanes BP1/BP2
;*drive the segments of the LCD
;*calculate duration of each duration phase
;**************************************************************************
SOMMEIL RES 0,FLAGS
LDI ORA,0CFh; A3 becomes interrupt input
LDI IOR,10h; valid interrupt
STOP; wait at ON/OFF button activation
LDI ORA,0C7h;
CLR IOR; inihibit INTERRUPTS
CALL CLAVIER; keyboard test
JRR 0,FLAGS,SOMMEIL ; IF no push on ON/OFF button , THEN stand by
I1BOUCLE RES 0,FLAGS; ELSE INITIALIZATION of MAIN LOOP
;**************************************************************************
;*END OF MAIN PROGRAM
;**************************************************************************
LDI TSCR,7Fh; program it at 1.5 ms
INC TABU; determine data/rom window address
INC TABD; of tables 1 & 2 for phase 2
CALL DATALCD; determine segments driver byte for PHASE 2
LDI ORA,07h; BP1 = Vdd/2 ; BP2 = Vss therefore
LDI DRA,40h
LDI DDRA,87h; A6 becomes high impedance input
LDI ORA,87h; & A7 becomes push pull output at Vss
LDDRB,A; load segments driver byte on port
WAIT
LDI TSCR,7Fh; program it at 1.5 ms
INC TABU; determine data/rom window address
INC TABD; of tables 1 & 2 for phase 2
CALL DATALCD; determine segments driver byte for PHASE 3
LDI DRA,0C0h; BP1 = Vdd/2 ; BP2 = Vdd therefore
LDDRB,A; load segments driver byte on port
WAIT
LDI TSCR,7Fh; program it at 1.5 ms
INC TABU; determine data/rom window address
INC TABD; of tables 1 & 2 for phase 2
CALL DATALCD; determine segments driver byte for PHASE 4
LDI ORA,07h; BP1 = Vss ; BP2 =A Vdd/2 therefore
LDI DRA,80h
LDI DDRA,47h; A6 becomes output at Vss
LDI ORA,47h; A7 becomes high impedance input
LDDRB,A; load segments driver byte on port
WAIT
LDI DRA,00h
LDI DDRA,0C7h
LDI ORA,0C7h; BP1 & BP2 on output to Vss
LDI DRB,00h
LDA,TOUCH
CPI A,0Ah; wait falling edge of ON/OFF button
JRZ PREPSOMM; before stop display mode
JPSOMMEIL
; A6 remains high impedance input
; A7 becomes push pull output at Vdd
; THEN circuit is in stand by & display is
; ELSE continue digits display
13/28
Direct LCD Drive
ANNEX 1: Software of the ST6215x based application (Continued)
;**************************************************************************
;*TABLE SUBROUTINE
;*
;* task : define LCD segments driver byte to load on port B
;*TABU defines half driver byte for L.S.DIGIT
;*TABD defines half driver byte for M.S.DIGIT
;**************************************************************************
DATALCD LDI DWR,3Ch; move data/rom window to L.S.DIGIT TABLE 2
;**************************************************************************
;*END OF TABLE SUBROUTINE
;**************************************************************************
LDI DWR,3Dh; move data/rom window to M.S.DIGIT TABLE 1
LDI A,40h
ADD A,TABD
LDX,A
LDA,(X)
AND A,Y; LCD driver byte is loaded in accumulator
RET
ANDI A,38h
CPI A,38h; test 2 times if some buttons are pushed
JRNZ CLAVIER2; IF yes THEN check them ( A3 -> A5 )
DEC LOOP
JRNZ CLAVIER1
LDI TOUCH,0FFh
JPCLAVIER4; ELSE test if keyboard is changed
LDA,DRA
ANDI A,38h
CPA,Y
JRZ TSTCOL; IF check is OK , THEN determine column
LDI TOUCH,0FFh
JPCLAVIER4; ELSE test if one button was pushed
JRR 4,Y,COL2; if A4 = 0 then column #2
JPTSTLIGN
JPTSTLIGN
14/28
ANNEX 1: Software of the ST6215x based application (Continued)
Direct LCD Drive
TSTLIGN RES 0,ORA;
LIGN1JPCLAVIER3; else row #1 is selected & TOUCH unchanged
LIGN2LDA,TOUCH
LIGN3LDA,TOUCH
LIGN4JRS 0,TOUCH,ONOFF1
ONOFF1LDI TOUCH,0Ah; TOUCH ∂ 0Ah means action on ON/OFF button
CLAVIER3 RES 3,ORA;
CLAVIER4 LDA,TOUCH
CLAVIER5 LDTOUCHP,A; ELSE TOUCHP ∂ TOUCH
CLAVIER7 CPI A,0Ah; ELSE test ON/OFF button
ONOFF2SET 0,FLAGS
FINCLAV RET
;*************************************************************************
;*END OF KEYBOARD SUBROUTINE
;*************************************************************************
RES 1,ORA;
RES 2,ORA; A0, A1 & A2 become open drain output
RES 0,DDRA;
RES 1,DDRA;
RES 2,DDRA; then pull up input
SET 3,DDRA;
SET 4,DDRA;
SET 5,DDRA; A3, A4 & A5 become open drain output
SET 3,ORA;
SET 4,ORA;
SET 5,ORA; then push pull output at Vss
LDA,DRA
ANDI A,07h
JRR 0,A,LIGN2; if A0 = 0 then row #2
JRR 1,A,LIGN3; if A1 = 0 then row #3
JRR 2,A,LIGN4; if A2 = 0 then row #4
RES 4,ORA;
RES 5,ORA; A3, A4 & A5 become open drain ouput
RES 3,DDRA;
RES 4,DDRA;
RES 5,DDRA; then pull up inputs
SET 0,DDRA;
SET 1,DDRA;
SET 2,DDRA; A0, A1 & A2 become open drain output
SET 0,ORA;
SET 1,ORA;
SET 2,ORA; then push pull output at Vss
CPA,TOUCHP
JRNZ CLAVIER5
JPFINCLAV; IF unchanged state keyboard THEN end
CPI A,0FFh
JRNZ CLAVIER7; IF any keyboard buttons are pushed
JPFINCLAV; THEN end of subroutine
JRZ ONOFF2; IF yes THEN set FLAGS
LDA,TOUCHU; ELSE shift keyboard value
LDTOUCHD,A;
LDA,TOUCH;
LDTOUCHU,A; to be displayed
JPFINCLAV
15/28
Direct LCD Drive
ANNEX 1: Software of the ST6215x based application (Continued)
;**************************************************************************
;*PORT A INTERRUPT SUBROUTINE
;**************************************************************************
T_ITPANOP
;**************************************************************************
;*END OF PORT A INTERRUPT SUBROUTINE
;**************************************************************************
;*
;*19 FEB 1993
;*
;*
;*
;*LCD005
;*
;**************************************************************************
;**************************************************************************
;*LCD DRIVER SOFTWARE PROGRAM
;*ST62E65
;*DUPLEXED CONTROL OF 2 DIGITS WITH PORT A;
;*PA0 to PA3 FOR DIGIT1;PA4 to PA7 FOR DIGIT2;
;*BACPLANES ON PB0 & PB1
FASTIM.equ 036h; duration of each LCD drive phase (14 ms at 8 MHz)
;************************************************************************
;************************************************************************
;***********************************************************************
;*MAIN PROGRAM EXAMPLE
;***********************************************************************
.org0880h
STARTreti ; end of reset interrupt
MAINcall DUTY0
;***********************************************************************
;*END OF MAIN PROGRAM
;***********************************************************************
ANNEX 2: Software of the ST6265x based application (Continued)
Direct LCD Drive
;***********************************************************************
;*END OF MAIN INITIALIZATION
;***********************************************************************
;************************************************************************
;*MAIN TASK EXAMPLE : ACQUISITION OF USER SPEED REFERENCE DUTY0*
;**
;*duty0 is a user reference that can vary from 0 to 255d*
;************************************************************************
DUTY0jrr2,pb,slower; if PB2=0,then slower ; priority on slower
;***********************************************************************
;*DUPLEXED LCD DRIVER INTERRUPT SUBROUTINE
;*
;* task : generate alternative signals of LCD backplanes control
;*drive the segments of LCD through port a
;*calculate duration of each LCD phase
;*
;***********************************************************************
LCD_LPldiwdt,0ffh; hello watchdog
;ldAUX1, a; |
;lda, x; | save context of main task (if needed)
;ldAUX3, a; |
;lditscr1,00h; timer stop (if needed)
;************************************************************************
;* LCD phase generation can be here synchronized by other clock system.
;*for instance : mains voltage synchronization or external clock
;************************************************************************
; determine phase1 operation
ret
jrr3,pb,faster; if PB3=0,then faster ; else continue
ret; if PB2 & PB3 are high; then continue
ldipbbuf,00000011b; pb buffer load
ldipb,00000011b; pb1 in High Impedance (HI) & pb0 to 0
ldipbdir,00110001b;
ldipbbuf,00000010b; pb buffer load
ldipb,00000010b;
ldpa,a; load segment driver byte on port a
lda,AUX3;|
ldx,a;|
lda,AUX2;|return to main tasks with context ;
lddrwr,a;| ( AUX2 <== drwr in main program )
lda,AUX1;|
clrLCDCTL; end of loop4 & full LCD sequence
ldipbopt,00110000b; pb0 in HI & pb1 to 0
ldipbdir,00110010b;
ldipbbuf,00000001b; pb buffer load
ldipb,00000001b;
ldpa ,a; load segment driver byte on port a
ldipbopt,00110000b; pb1 in HI & pb0 to 1
ldipbdir,00110001b;
ldipbopt,00110001b;
ldpa,a; load segment driver byte on port a
22/28
ANNEX 2: Software of the ST6265x based application (Continued)
set1,LCDCTL; end of loop2
reti
;*************************PHASE 1*********************************
LOOP1callDECCONV; do hexa-decimal data conversion
;lda,AUX3;
;ldx,a;
;lda,AUX2; return to main tasks with context
;lddrwr,a;(AUX2 <== drwr in main program)
;lda,AUX1;
;************************************************************************
;*END OF LCD DRIVER SUBROUTINE
;************************************************************************
;************************************************************************
;*DEC DATA/LCD SEGMEMTS CONVERSION SUBROUTINE
;*
;* task : calculate the segments driver byte of the LCD
;*depends on the displayed data AND on the # of phase
;*based on DIG1 & DIG2 calculation
;*LCD segments driver full byte is in accumulator
;************************************************************************
DATALCD ldidrwr,3ch; move data/rom window on DIGIT2 table
;************************************************************************
;*END OF DATA/LCD CONVERSION SUBROUTINE
;************************************************************************
callDATALCD; calculate phase1 segment driver byte
ldipbbuf,00000011b; pb buffer load
ldipb,00000011b; b1 to 1 &b0 in HI
ldipbdir,00110010b; b2 — > b7 unchanged
ldipbopt,00110010b;
ldpa,a;load segment driver byte on port a
ANNEX 2: Software of the ST6265x based application (Continued)
;************************************************************************
;*HEXADECIMAL — > DECIMAL DATA CONVERSION SUBROUTINE
;*
;* task : convert an hexadecimal data in a Binary Coded Decimal data
;*determine data/rom window address of segments driver byte
;*
;*
;*hexadecimal data is a stable data varying from 0 to 256
;*result is a percent decimal data varying from 0 to 99
;*BCD Binary Coded Decimal data
;*
;*for instance, data is duty0
;*
;*DIG1 = data/rom WDW @ of DIGIT1 segments driver = 01wxyzAB
;*DIGIT1 = wxyz ( from 0 to 9 ) and
;*AB are defined by phase operation : AB = 00 for phase1 ...
;*AB = 11 for phase4
;*DIG2 = data/rom WDXW @ of DIGIT2 segments driver
;*similar writing than DIG1
;*
;*************************************************************************
DECCONV jrr7,duty0,ET1; DATA <== duty0
ET1ldidrwr,038h; b7 of DATA is 0 : 00 < DATA < 49
ET2lda,duty0;
ldidrwr,039h; b7 of DATA is 1 : 50 < DATA < 99
jpET2
rlca;
rlca;
rlca; calculation of BinCodDec DATA
rlca; address
rlca;
andia,00fh; determine DIGIT1 value and the
slaa; data/rom address of DIGIT1 segments
slaa; driver
addia,040h;
ldDIG1,a; DIG1 = data/rom @ of segment driver
lda,BCD; determine DIGIT2 value and the
andia,0f0h; data/rom address of DIGIT2 segments
rlca; driver
rlca;
rlca;
rlca;
rlca;
slaa;
slaa;
24/28
ANNEX 2: Software of the ST6265x based application (Continued)
addia,040h;
ldDIG2,a; DIG2 = data/rom @ of LCD driver
;***********************************************************************
;*END OF HEXA — > DECIMAL DATA CONVERSION SUBROUTINE
;***********************************************************************
;***********************************************************************
;*TABLE OF HEXA — > DECIMAL DATA CONVERSION ( 00 TO 49 BinCodDec )
;***********************************************************************
;***********************************************************************
;*END OF HEXA —> DECIMAL DATA CONVERSION TABLE ( 00 to 49 )
;***********************************************************************
;***********************************************************************
;*TABLE OF HEXA —> DECIMAL DATA CONVERSION ( 50 to 99 BinCodDec )
;***********************************************************************
;***********************************************************************
;*END OF HEXA — > DECIMAL DATA CONVERSION TABLE ( 50 to 99 )
;***********************************************************************
;***********************************************************************
;*SEGMENT CONTROL WITHOUT ANY POINT DISPLAY
;*PA0,4 —-> SEG CB
;*PA1,5 —-> SEG DH
;*PA2,6 —-> SEG DH
;*PA3,7 —-> SEG GA
;*
;*PA0,PA1,PA2,PA3—-> DIGIT1
;*PA4,PA5,PA6,PA7—-> DIGIT2
;*
;*Backplane #1 (pb1) biases C,D,E,G
;*Backplane #2 (pb0) biases A,B,F,H
;*
;*These tables are dedicated to one LCD type with two digits and LCD
;*control is described above ; when LCD is changing these tables have
;* to be modified
ret
a
fb
g
e
c
d
Direct LCD Drive
25/28
Direct LCD Drive
ANNEX 2: Software of the ST6265x based application (Continued)
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its
subsidiaries (“ST”) reserve the right to make changes, corrections, modifications or improvements, to this document,
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein,
and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by
ST for the use of such third party products or services, or any intellectual property contained therein or considered as a
warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS
ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST
PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF
ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER
UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST
PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY,
AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS
OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,
DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE
NOT SPECIFIED AS “AUTOMOTIVE GRADE” MAY ONLY BE USED IN AUTOMOTIVE
Resale of ST products with provisions different from the statements and/or technical features set forth in this document
shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or
and the products and services described herein at any time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
described herein.
contained therein.
INTELLECTUAL PROPERTY RIGHT.
APPLICATIONS AT USER’S OWN RISK.
extend in any manner whatsoever, any liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective