23.02.2014 Views

Driving a character type LCD from a PC printer port - Hantronix, Inc

Driving a character type LCD from a PC printer port - Hantronix, Inc

Driving a character type LCD from a PC printer port - Hantronix, Inc

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Application Note<br />

Crystal Clear and Visibly Superior <strong>LCD</strong> Modules<br />

sourceupto10mA, soitispossibletopowerthe<strong>LCD</strong><strong>from</strong> oneof theoutput lines. This doesn’t apply to the<br />

back light whichrequires <strong>from</strong> 50mA to300mA. Oneof thecontrollines canbeusedforthis purposeas shown<br />

C2 16<br />

Figure2<br />

1N4148<br />

+<br />

1uF<br />

V DD<br />

P<br />

A<br />

R<br />

A<br />

LL<br />

E<br />

L<br />

P<br />

O<br />

R<br />

T<br />

D0 2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

D7 9<br />

C0 1<br />

C3 17<br />

D0<br />

<strong>LCD</strong> Display Module<br />

D7 E RS R/W V SS<br />

V DD V DD<br />

10K<br />

10k 10k<br />

V L<br />

V DD<br />

V DD<br />

Schematic<br />

inFigure2. This alsohas theadvantageof being abletoshutoff thedisplay viasoftware. A1onthisline turns<br />

thedisplay onand a0turns it off.<br />

The<strong>type</strong> of cableusedtoconnectthe parallel <strong>port</strong> tothe<strong>LCD</strong>will determinethemaximumlengthofthe cable.<br />

Ribboncable, forinstance, shouldnot beusedinlengths over3’.Ashielded, twistedpaircablecanbeused<br />

upto50’. The quickest and most economical way ofbuildingashielded, twistedpairin smallquantities is to<br />

useacommercial <strong>printer</strong>cableof thedesiredlengthandcut offtheconnectorthatwould normallyconnect to<br />

the<strong>printer</strong>. The wiresarethenpreparedand connectedtothe<strong>LCD</strong>module.<br />

Software:<br />

Most contemporary <strong>PC</strong>s sup<strong>port</strong> 3parallel<strong>port</strong>s at addresses 278/378/3BC. All values areinhex. Usually only<br />

one <strong>port</strong>isphysically installed andinmostsystems it is at address 378 andis assignedtoLPT1. Anoutput<br />

instructiontothe base addressof the<strong>port</strong>,278/378/3BC, willlatchdatatothe data <strong>port</strong>of the<strong>LCD</strong>as shown<br />

below.<br />

BIT 7 6 5 4 3 2 1 0<br />

PIN 9 8 7 6 5 4 3 2<br />

<strong>LCD</strong> D7 D6 D5 D4 D3 D2 D1 D0<br />

Anoutputinstructiontothebaseaddress ofthe<strong>port</strong> +2, 27A/37A/3BE, willlatchthelower 4bits of thedata<br />

bus tothecontrolpins of the<strong>LCD</strong>. Onlytwoof thesesignals areneededtocontrolmost <strong>LCD</strong><strong>character</strong><br />

modules.Theexceptionis the40<strong>character</strong>by4linemodules. Thesemodules havetwocontrollers onthem<br />

and havean extraenableline.The<strong>port</strong> pinC1canbeusedforthis 2ndenableonthe40x4modules.Thebits<br />

areassigned tothe<strong>LCD</strong>as shownbelow.<br />

BIT 7 6 5 4 3 2 1 0<br />

PIN - - - - 17 16 14 1<br />

<strong>LCD</strong> RS E2* E *=40x4modules only.<br />

Page2<br />

Copyright 2000, <strong>Hantronix</strong>,<strong>Inc</strong>.Allrights reserved

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!