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

SOFTWANE 30?


                  ]:!iil€ni!*iilU   Data rossins

                   CLE]AR
                   DEFINE  OSC  4                         define  Osc  Speed
                   DIFTNE  LCD_DREE  PORTD                defne  the  LCD connectrons
                   DEFINE  LCD_DBIT   4                   as  we  always  do
                   DEFINE  LCD_RSREG  PORTE
                   DEFINE  I,CD.RSBIT   O
                   DEFINE  I.CD,ERTG  PORTE
                   DEFINE  I,CD_EBIT   1
                   t olf  PoRnE-2
                   TRISA  =  %00010000
                   TRISB  =  %11110000
                   fRtSC  =  %11110000
                   tRtSD  =  %00000000
                   tRIsE  =  %00000000
                   ADCONI=  %00000111
                   PAUSE  500                             pause  .500 second for  LCD  stdtup
                   LCDOIt[  SFE,  1.   ..Clear"           clear  LCD,  go  to  fl.s!  line
                   UAIN:
                   GOSI'3  REA.D_CLOCK
                   GOSttB  RE]A.D_SEIISORS
                   GOSI'I  CONIPROL_FAN
                   GOSI'B  T'PDAIFE_LCD
                   IF  RTCSEC .$00  TaE{  @SltB  SE{D  DaEA  sedd  data  whed  seconds  iead  00
                   GO!t9  MAIII
                   END

                     The subroutines  called in the  preceding  code are developed  in the following  section.
                  A sho  description  precedes  each oode listing.


                   SETTII{G  IHE  INTERNAL CLOCK
                   There are seven  registers of interest in the NJU6355 clock  module. They contain the
                   following  pieces  oi  jnformation:



                     Month

                     Date
                     Day
                     Hours
                     Minutes

                     Seconds
   300   301   302   303   304   305   306   307   308   309   310