Page 314 - Embedded Microprocessor Systems Real World Design
P. 314

(Update display)
                   Turn all displays off
                   INCR DISPLY.
                   If  DISPLY = 4, DISPLY = 3 (DISPLY  counts 0-3).
                   If  MODE  = 0 (Powerfail),
                     If  BLFLAG  (Time to blink display),
                      If  DISPLY = 0, convert minutes ones to 7-seg and write to display reg.
                      If  DISPLY  =  1, convert minutes tens to  7-seg and write to display reg.
                      If  DISPLY = 2, convert hours ones to 7-seg and write to display reg.
                      If  DISPLY = 3, convert hours tens to 7-seg and write to display reg.
                   If  MODE  =  1 (normal timekeeping),
                     If  override time = 0:O (OVHOUR = OVMIN = 01,
                      If  DISPLY  = 0, convert minutes ones to 7-seg and write to display reg.
                      If  DISPLY =  1, convert minutes tens to 7-seg and write to display reg.
                      If  DISPLY  = 2, convert hours ones to  7-seg and write to display reg.
                      If  DISPLY  = 3, convert hours tens to 7-seg and write to display reg.
                     Else (Override time was > O:O),
                      If  DISPLY  = 0, convert OVMIN ones to 7-seg and write to display reg.
                      If  DISPLY  = 1, convert OVMIN tens to 7-seg and write to display reg.
                      If  DISPLY  = 2, convert OVHOUR ones to 7-seg and write to display reg.
                      If  DISPLY = 3, convert OVHOUR tens to 7-seg and write to display reg.
                   If  MODE  = 2 (time set),
                      If  DISPLY  = 0, convert PRMIN ones to  7-seg and write to display reg.
                      If  DISPLY = 1, convert PRMIN tens to 7-seg and write to display reg.
                      If  DISPLY  = 2, convert PRHOUR  ones to  7-seg and write to display reg.
                      If  DISPLY  = 3, convert PRHOUR  tens to 7-seg and write to display reg.
                   (Now  update the discrete status LEDs.)
                   If  MODE  = 0 or 1 (Powerfail or normal timekeeping),
                     Turn off  SET LED.
                     If ONOFF (Timing ON time)
                     OR if  OVTIME  > 0 and VOFLAcf  set (ON override),
                      If  not MTI?L,AG Water level OK),
                       Turn on ON/OFF  LED.
                      Else (MTFLAG set, water level low),
                       If  BLF’LAG, Turn on ON/OFF  LED (Makes LED blink).
                     If  not ONOFF
                     OR if  not VOFLAG, turn off  ON/OFF LED.
                   If  MODE  = 2 (time set),
                     Turn on SET LED.
                     If  SEMODE =  1,
                      If not MTFLAG  Water level OK),
                       Turn on QN/OFF LED.
                      Else (MTFLA(3 set, water level low),
                       If  BLFLAG, Turn on ON/OW  LED (Makes  LED blink).
                     If  SEMODE = 0, turn off  ON/OFF  LED.



                Appendix A                                                           295
   309   310   311   312   313   314   315   316   317   318   319