Page 120 - PDA Robotics Using Your Personal Digital Assistant to Control Your Robot
P. 120

PDA 05  5/30/03  11:35 AM  Page 96
                                                     PDA Robotics
                                                                 When no prescaler is used,
                          Using Timer0 with an External Clock.
                          the external clock input is the same as the prescaler output. The syn-
                          chronization of T0CKI with the internal phase clocks is accomplished
                          by sampling the prescaler output on the Q2 and Q4 cycles of the inter-
                          nal phase clocks. Therefore, it is necessary for T0CKI to be high for at
                          least 2Tosc (and a small RC delay of 20 ns) and low for at least 2Tosc
                          (and a small RC delay of 20 ns).
                          Prescaler.  There is only one prescaler available, which is mutually
                          exclusively  shared  between  the  Timer0  module  and  the  WDT.  A
                          prescaler  assignment  for  the  Timer0  module  means  that  there  is  no
                          prescaler for the WDT, and vice versa. This prescaler is not readable or
                          writable (see Figure 5.39).

                          The  PSA  and  PS2:PS0  bits  (OPTION_REG<3:0>)  determine  the
                          prescaler assignment and prescale ratio. When assigned to the Timer0
                          module, all instructions writing to the TMR0 register (e.g., CLRF 1,
                          MOVWF  1,  BSF  1,  etc.)  will  clear  the  prescaler.  When  assigned  to
                          WDT, a CLRWDT instruction will clear the prescaler along with the
                          WDT. The prescaler is not readable or writable.
                          Note:  Writing  to  TMR0,  when  the  prescaler  is  assigned  to  Timer0,
                          will  clear  the  prescaler  count,  but  will  not  change  the  prescaler
                          assignment.


                          The L298 Dual Full-Bridge Driver
                          (PDA Robot Motor Controller)

                          •    Operating supply voltage up to 46 V
                          •    Total DC current up to 4 A

                          •    Low saturation voltage
                          •    Over temperature protection
                          •    Logical ”0” Input voltage up to 1.5 V (high noise immunity)

                          Figure 5.41 shows two of the three available packages that the L298
                          comes in. In this project, we are using the vertical package shown on
                          the left.





                          96
   115   116   117   118   119   120   121   122   123   124   125