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

THE HAFDWARE    't45










                     1                            Logic  ground
                     2                            Logic  power  5 volts
                     3                            Contmst of the display, can usually be  grounded.
                                                  Fegisterselect  )These  are
                     5                            Read,ll/fiie   )lhe  3 control
                     6                            Enabe        )  lines
                     7
                     8
                     I
                     1 0
                     1 1                          )8  nes      )hall  ofthe  pon
                     '12
                                                  )  ot  daia   )  can also
                     1 3                          )            )  be used
                                                  )            )see  PBP  manual
                                                  Backlight  power  )These  hvo lines can
                                                  Backlight  ground   )usually  be ignored



                  only one PIC in this book. in our case this means we will use the 16F877A. I h.tve
                  included the circritry and code tbr this in the Progfam  9.1  and F-igure 9.1 so  you  caD
                  scc cxacdv  what nccds  to bc donc.
                    To keep ir simple. lel's use PORTA and PORTB. because lhesc  ports  arc available
                  on cven thc slnailcr MCLIS. and if we use a dedicared MCU ro control our l-CD.  i! will
                  in all  prcbabiiity  be a smallernore inexpensive l8'or20-pinMCU.  Let's use thclincs



                    Lincs | 1o 3 of PORTA  as lhc conlrol  lincs  and
                    Lhes 0 to 7 ofPORTB ris the data lines

                    \  re  can redefine these to be more rational addresses whenever $,e want. and none of
                  the  pfogramming  will have to change. Just DEFINE what  pofts  and lines  you  want to
                  use atthe top ofthe  progmm.  and the aliases assigned to their will identify then as needed.
                    with this in mind. let's  create  the  sotiwarc to conlol a 2 line by-16 charactef dis-
                  plalr.  Oncc wc arc  happy  wilh lvhat wc  havc  crealed. wc can  migralc  lhc codc  1()  other
   148   149   150   151   152   153   154   155   156   157   158