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

You alo  noi need  the  full  datasheet.  which is abolrt  40 pages long' bui you do need  to
                    know the basic  command  set that controls the data tra$fer  1o  your particular display
                    Thi  s is usually  provided  by the organization  you  buy the  LCD from and  consists  ol two
                    or three  pages. You  will need  1o refer  to the  dalasheet  only  if you want 1o  creale  specral
                    .t,*u"t"'..,_o.  if yoo *nnt  to display bargraphs  and  the like on tbe display The control
                                                                  butyou don'tneed  tobe famil
                    the Hitachi  controller  provides is very  comprehensive,
                    iar with it to use  a display effectively.  Everything  you need to know willbe  covered  in
                    this exerci  se, but that should  not keep  you from learning  as much  as  you can abou!  con-
                    trolling  the  displays



                    Talkin to the  LCD


                    The  precerlilg confol  codes  allow you to configure  the  display' set display  parameters'
                    set  tie  shape  ind  position of the  cursol and so  on To differentiate  them  from the char-
                    acter  conmands,  iach  control code  must be  preceded by a hexadecimal  FE or a deci'
                    mdl 254 to tell the  confoller  lhal the next character  sent  to lhe display will  be a control
                    code.  After receiving one control code and its argument'  the Hitachi controller resets
                    to ihe data mode  automaticaLly.
                       The  controller  suppots  theASCII  standard  All uppercase  and  lowercase  chamclers
                    ancl  numerals  are  supported,  as  ale  punctuation  narks and the  standad  lext support  char-
                     acters.  (The controller also  suppofts  the display of a set of Japanese  kana characte$')
                       It is ;1so  possible to design  your  own  font for use  with the displays  (though five
                     by seven  [oi  even  ten] dots  ;nd rwo lines  does  limit what can  be done)  All the infor-
                     mation  needed  to tlo so is contained  in the Hitachi  HD4'{780U  datasheets  Greek
                                                                            l
                                                                                    5
                                                                  b
                                                                     u
                                          t
                     .turu","rr na enain cientific olarioni \  ould e selul or  mosl cienLr[ic
                                                   n
                               u
                                   c
                     aDDlications.
                     The  Hardware
                     Let's take  a closer  look at  the LCD hardware.
                       Studv  lhe datasheet  that came with t}}e  LCD. Find the  pin-out descriptions  and  study
                     them.  ihe  16  pins  ar" osually  identified  as shown  in Table 9 2'
                                                                               displays'  we  find
                       Looking  at ihe datasheet  provided wirh the  2-line-by-16-characier
                     that the c;nfiol  implementation  can take  Place  if  we have bodl a poft and a few lines
                     available  to control  the LCD. It does  not have to be  controlled  from any  predefined  lines'
                     We can select  all the lines needed  to support  the display in our project and  they can  be
                     on any  port we have  available The only requirement  seems  to be  that  the four/eight  data
                     line  be either  the  contiguous  top,  or the  bottom  half, of a  po  This  is not a  paticularly
                     demanrling  requirement  other  lban  that it means  the smaller  PICS  cannot  be used if we
                     will  retlLrire  many I/o  lines in our project The other thtee  lines needed  can be on any
                     of the other  ports.  and  do not all need  to be on lhe same  pol1 Since  we are  considering
   147   148   149   150   151   152   153   154   155   156   157