Interfacing Alphanumeric LCD to Parallel Port Using Visual Basic 6
-
Upload
mariorobertofernandezrothar -
Category
Documents
-
view
238 -
download
4
description
Transcript of Interfacing Alphanumeric LCD to Parallel Port Using Visual Basic 6
7/17/2019 Interfacing Alphanumeric LCD to Parallel Port Using Visual Basic 6
http://slidepdf.com/reader/full/interfacing-alphanumeric-lcd-to-parallel-port-using-visual-basic-6 1/6
Interfacing Alphanumeric LCD to Parallel
Port using Visual Basic 6.0
Nimish Dave 2006nimishgmail.com
!ello "rien#s $ scrolling #o%n this page %ill let &ou learn a ver& eas& tutorial for
interfacing alphanumeric LCD '6(2 to parallel port of &our computer using Visual
Basic 6.0
Before staring %ith VB6 programming one shoul# )e clear %ith the concepts of the
parallel port. *efer this lin+ Parallel port tutorial.,ore information
Connection Diagram-
Caution-,a+e sure that V an# /ND lines are properl& connecte# other%ise &ou ma&
en# up in #amaging parallel port.
7/17/2019 Interfacing Alphanumeric LCD to Parallel Port Using Visual Basic 6
http://slidepdf.com/reader/full/interfacing-alphanumeric-lcd-to-parallel-port-using-visual-basic-6 2/6
If &ou %ant )ac+light than connect pin ' of LCD to V an# pin '6 of LCD to /ND.
B& a#usting '0+ resistor ma+e pin 1 of LCD at 0V. If connection are proper &ou %ill
see this after po%er on.
Pin Information of LCD-
Algorithm to sen# #ata to LCD-
'.,a+e *3 lo%
2.,a+e *450 if #ata )&te is comman#
*45' if #ata )&te is #ata 7A4CII value8
1.Place #ata )&te on #ata register
9.Pulse : 7!I/! to L;38
.*epeat the steps to sen# another #ata )&te
LCD Initiali<ation-
7/17/2019 Interfacing Alphanumeric LCD to Parallel Port Using Visual Basic 6
http://slidepdf.com/reader/full/interfacing-alphanumeric-lcd-to-parallel-port-using-visual-basic-6 3/6
=his is the pit fall for )eginners.Proper %or+ing of LCD #epen# on the ho% the LCD
is initiali<e#. 3e have to sen# fe% comman# )&tes to initiali<e the lc#. 4imple steps to
initiali<e the LCD
'.4pecif& function set-
4en# 1>! for >?)it@#ou)le line an# ( #ot character format.
2.Displa& ;n?;ff control-
4en# 0"! for #ispla& an# )lin+ cursor on.
1.:ntr& mo#e set-
4en# 06! for cursor in increment position an# shift is invisi)le.
9. Clear #ispla&-
4en# 0'! to clear #ispla& an# return cursor to home position.
N;=:-;ne must refer the #atasheet of LCD to get the proper time #ela& an# reuire#
seuence.
Clic+ here - Interface LCD %ith >0'
,aor hur#le in accessing parallel port in 3in#o%s p is the +no%le#ge of using
inpout12 files.Do%nloa# these files Driver files
No% save inpout12.#ll an# port.#ll in s&stem12 fol#er in %in#o%s #irector&.3e %ill
use certain su)routine provi#e# )& these #ll files in our VB6 co#e.;pen ne% proect in
VB6 an# create the form as sho%n )elo%.
7/17/2019 Interfacing Alphanumeric LCD to Parallel Port Using Visual Basic 6
http://slidepdf.com/reader/full/interfacing-alphanumeric-lcd-to-parallel-port-using-visual-basic-6 4/6
4et the ,a(length of t%o te(t)o(es to '6.Create 4tart an# Clear comman#
)utton.No% #ou)le clic+ on form an# cop& paste the co#e given )elo%.
Visual Basic Co#e
Dim #ata As Variant
Private 4u) ClearEClic+78
LowRsOut Val(&H378), Val(1) ' function to send data to parallel port
Enale
t!tlcd1"#e!t $ % % ' line 1 for Lt!tlcd"#e!t $ % % ' line for L
:n# 4u)
Private 4u) 4tartEClic+78
Out Val(&H37), Val(*np(&H37) nd &H+)lcdint
L-rite.trin/ t!tlcd1"#e!t
ne!tline ' function to set cursor to second lineL-rite.trin/ t!tlcd"#e!t
:n# 4u)
4u) Lo%*s78
Out Val(&H37), Val(*np(&H37) Or &H8) ' Rs Low
:n# 4u)
4u) Lo%:n78
Out Val(&H37), Val(*np(&H37) Or &H1) ' En Low
:n# 4u)
4u) !igh*s78
Out Val(&H37), Val(*np(&H37) nd &H+7) ' Rs Hi/0
:n# 4u)
4u) !igh:n78
Out Val(&H37), Val(*np(&H37) nd &H+E) ' En Hi/0
:n# 4u)
4u) lc#E%rite7#ataF8
Hi/0Rs
Out Val(&H378), Val(data)
Enale
:n# 4u)
7/17/2019 Interfacing Alphanumeric LCD to Parallel Port Using Visual Basic 6
http://slidepdf.com/reader/full/interfacing-alphanumeric-lcd-to-parallel-port-using-visual-basic-6 5/6
4u) ne(tEline78
LowRs
Out Val(&H378), Val(&H)Enale
:n# 4u)
4u) lc#Eint78 'suroutine to initiali2e L
LowRs
Out Val(&H378), Val(&H38)
EnaleLowRs
Out Val(&H378), Val(&H)
EnaleLowRs
Out Val(&H378), Val(&H)
EnaleLowRs
Out Val(&H378), Val(&H1)
Enale
:n# 4u)
4u) :na)le78
EL45. Hi/0En
EL45.
LowEn
EL45.
:n# 4u)
' function to send .** c0aracter one 6 one to L
Pu)lic 4u) LCD3rite4tring7B&Val ;ut4tr As 4tring8
i i s *nte/er 'write a strin/ to L+or i $ 1 #o Len(Out.tr)
lcdwrite (s(sc(id(Out.tr, i, 1))))
9e!t i
:n# 4u)
No% go to ProectGA## ,o#ule .4elect inpout9.)as an# port.)as
7/17/2019 Interfacing Alphanumeric LCD to Parallel Port Using Visual Basic 6
http://slidepdf.com/reader/full/interfacing-alphanumeric-lcd-to-parallel-port-using-visual-basic-6 6/6
4u)routine ;ut Val 7Ha##ress8@ Val7#ata8 an# D:LAJ4 2000 is foun# in inpout4.bas
an# port.bas respectivel&. *eferPC Interfaces Jn#er 3in#o%s
*unning the Program-
'.Press " to run the program
2.3rite the te(t &ou %ant to #ispla& on the LCD in the te(t )o(es
1.Clic+ 4tart comman# )utton.
9.ou %ill see that the same te(t appears on LCD as sho%n in the te(t )o(es.
.=o sen# other te(t clic+ Clear comman# )utton an# repeat the same proce#ure.