Page 155 - Understanding Automotive Electronics
P. 155

2735 | CH 4  Page 142  Tuesday, March 10, 1998  11:06 AM



                4                     MICROCOMPUTER INSTRUMENTATION AND CONTROL





                Figure 4.25
                Illustration of Table
                Lookup and
                Interpolation




                                                     FPO













                                      tabulated values, the value for X  corresponding to V  is found by linear
                                                                                  o
                                      interpolation:


                                                                       (
                                                      X =  X 1 +  ( X 2 –  X 1 ) V o –  V 2 )/ V 1 –  V 2 )
                                                                                (

                                          A microcomputer can perform the same operation using tabulated values
                                      for the relationship between V  and X (i.e., V  (X ) in correct mathematical
                                                               o
                                                                           o
                                      notation). This method is illustrated using a specific example of the
                                      measurement of a variable X using a sensor output voltage, and variable X  is
                                      assumed to be that which is illustrated in Figure 4.24.  A microcomputer is to
                                      obtain the value for X using a table lookup operation.
                                          The portion of the microcomputer that is involved in the table lookup
                                      process is illustrated in Figure 4.26. The relationship V  (X ) is stored in ROM
                                                                                    o
                                      for representative points along the curve. This data is stored using V  values as
                                                                                               o
                                      addresses, and corresponding values of X as data. For example, consider a point
                                      (V , X ). The data X is stored at memory location V  in binary format.
                                                                                  1
                                                       1
                                           1
                                        1
                                          The operation of the table lookup is as follows. The sensor S has output
                                      voltage V . The computer reads the values of V  (using an ADC to convert to
                                             o
                                                                            o
                                      digital format) through the I/O device. Then the MPU under program control
                                      (program ROM) calculates the addresses for the two nearest values toV , which
                                                                                                o
                                      are V  and V  (V  < V  < V ).  The computer, under program control, reads values
                                          1
                                                   1
                                                2
                                                           2
                                                       o
                                      X  and X  and then calculates X using the preceding formula.
                                             2
                                       1
                142                   UNDERSTANDING AUTOMOTIVE ELECTRONICS
   150   151   152   153   154   155   156   157   158   159   160