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

COUNTING  PULSES:

                  A PROGRAMMABLE  TACHOMETER
















                  Proiect  I


                  In thj s  first project, we build a  programmable  tachometer that can delect belween  I and
                  9999  pulses  a second  (or another time period)  and display the results  on 4 seven
                  segment LED numeric displays. Thesepulses can be  counted in two ways.Ifwe know
                  we are  getting  a fixed duty  cycle square wave, we can measure  lhe total length of a  pulse
                  and detemine the frequency of the signal from that. If the pulses  are not coming at a
                  regular rate, we can actually  count the  pulses  over time and  determine the rate ihat way-
                  We can write the software  for both techniques so we can see the difference. At the end
                  of the  project,  we will  take the source of the  pulses  into consideration  and discuss how
                  to modify the software to display an actual  rpm (revolutions per rlinute).
                    when working with miooprccessors, much of the infonnation we deal with is read
                  and  processed  as  pulses,  counts, frequencies, and the  like  because  miooprccessors  are
                  digitaldevices, and are usually  not designed for handljng analog  vdlues. So il becomes
                  impotant  that you be comfortable  with gathering, processing, and displaying infbrma-
                  tion of a digital nature, and this project focuses on that aspect of our knowledge and
                  understanding  regading microprocessors. Once  you  are comforlable with the  design and
                  consfuction of this  tachometer,  you will be able to  handle all other frcquency input  proj-
                  ects with confidence.
                    We will  use the LAB-XI  board  as a helper instrument as  we go along. Fhst, we will
                  make  the software work on the LAB-XI  (when  we can) and once  we know we can rcad,
                  count, and display the inputs the way we want, we will  move on to the fabrication of
                                  LED based tacbometer showr  in Figure 15.1.
                  the seven-segmert
                    In this project,  the LAB  X1 will  be  particularly helpful because seven-segmenl  dis
                  plays  require a  lot or wiring (that  can  go  \\'ong) and it can be dillicult to get  things  sorted




                                                                                       147
   186   187   188   189   190   191   192   193   194   195   196