Page 150 - Making PIC Microcontroller Instruments and Controllers
P. 150

la2   USlllG  LIQUID CFYSIAL  DISPLAYS:  At{ EXTE DED lt{FOFii|AtlOl{ EESOUnCE

























                                  A 2-line-by-i6  character  LCD  module.  (One-  or twoline
                     &!AISH!KS
                      LCDS can add  a lremendous  amounl  of utililyto  a proiect  )



                     the  LCD as determined  by the maoufacturer.  You  can also  sdoll  the  display up and down
                     if  you design  the commands,  and write the software'  to do so This is not built into the
                     LCD or the controller  soflwdre.  A typical  16  x 2 display is shown  in Figure 9 I


                     Usin LCDs  in Your  Pro


                     It is generally agreed  that most  projects  benefit  from having a one-  or twoline  display
                     incofoorated  in them. Howevet  these displays tend to be mther pricey (about $50)
                     whe;provided  with the  necessary controlling IC, and  quite reasonable  (about  $5  to $6)
                     when bought without the supporting  package.  Since  a PIC micmcontroller can  be pur-
                     chaseal  for about  $5, we should  be able  to have  a complete  display unit for a marginal
                     cost of around  $10  if we can  figure out how to prograrn  our PIC microcontrcller to con
                     trol the display.
                       The readily available  and inexpensive  2-line-by-  16-character  LCD  ($6 at All
                     Electronics)  offers  us the  ability to  display  information  in a limited  butuseful  way  jn
                     ourprojects.  Mastedng  theuse  of this  LCD display  means  we have  gained  the  expert_
                     ise to write any  charactet  at any locatioll,  at any  time' or in response  to any  event'
                      whenever  we want.  This chapter  aaldresses  problem in detail and  tells  you what
                                                           this
                      you  need to know  anal do to make these  displays  inexpensive  additions  to all ofyour
                      proJects.
                      _
                        In this  chapter,  you will leam how to control  an LCD  The code  you create  will
                      be able to be incorporated  into almost any  PICBASIC  PRO  program and will coII-
                      trol the LCD from any  available  half  port  (nibble)  and  three other  ftee  I/O lines The
                      code  $  ill be  mofe llnraf  lhan il needs lo be  \o  ou can  see eraclly  $  har  i' going  nn'
                                                             )
   145   146   147   148   149   150   151   152   153   154   155