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

uslllc  tlMEni  cout{TEF  foDE   255



                  lilRXiii!.liaitltll::   Final  program  for counting  marbles  Inlo  theTMBl  counter
                   (Connecl  seruo to  J7)  (Cort tued)
                           the
                   DISASI,E                           disable  interrupts
                      IMT  ROI'TINE.                   interrupc   rou!ine
                        EOGGIJE  PORTB'  1
                        ITOGGT,E  PORAB.I
                        x-255*!rMRllt   +  lltRll
                        IMICON.l-0                     reseL  tbe  intedupt   flaq  for
                      RESUIE
                    ENIIBLE                            enable  in!errupts

                    GATE_IN  !
                      HIGA  PORTC.I
                      PAUSEUS  2300                    CW
                      r,ow PoRrfc  - 1
                      PAUSE  Id
                    RETORN
                    GATE_OuI:
                      HIGII  PORTC.I
                      PAVSELS  750
                      LOW PORTC.l
                      PAUSE  !!
                    RETURN
                    END














                             f       ./Jl
                             TRANSISTOB

                             1 MEG





            is6.ductng.    :-
             Fbile  !?^3   Dlagram  ol the  wiring needed  to
                                    "nornally
             test  the counter.  (The  hiqh   oper"  cond-
             iion  here malches  the  weak high  pullup  on  B O as it
              should.)
   252   253   254   255   256   257   258   259   260   261   262