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

sured gap spacing and motor speed. These were captured on a logic analyzer along
               with  lead  edge, trail edge, interrupt, and some other information. A number of
               documents were  measured  and  the  process used  to  generate  a  correction  was
               checked when an error occurred. The problem turned out to be that one of  the
               tables, used in the middle of the correction calculation, had an incorrect entry in
               the last position. We did not have access to the PC code used to generate the tables,
               but the math calculations were documented in the source code for the firmware,
               so  we  were able to determine what  the correct value should be. Apparently, the
               program that generated that particular table did not calculate the final entry cor-
               rectly. This error would propagate through the calculation process, resulting in an
               incorrect rampdown/rampup  profile.
                  This  example  illustrates  a  number  of  issues  common  to  many  embedded
               problems:
                 Two problems produced similar symptoms. The original problem produced both
                 spacing and throughput errors. The second problem  produced  spacing errors
                 only. However, the effects of the second error were much smaller and were invis-
                 ible until the original problem was solved.
                 The problem could potentially have been caused by software, electrical, mechan-
                 ical, or even specification errors. A process of elimination was required to isolate
                 the actual cause.
                 The extreme lag between the creation  of the error  (in the spacing correction
                 code) and detection of the error (at the second sensor), made this problem dif-
                 ficult to solve. Many emulators, even today, would not have sufficient trace capa-
                 bility to solve this without using action codes or some similar technique.
                 The  problem  actually  occurred  only  for  certain  combinations  of  document
                 length and motor speed. That is, for a given motor speed, only a certain range
                 of document lengths would create the problem. However, since motor speed was
                 invisible to the operator, the problem appeared to be random  until the actual
                 cause was discovered.
                 The error in the table did not produce disastrous results. It was not used on all
                 documents and even when it was used, it was close enough to the correct value
                 that the software did not “blow up” with some obviously incorrect value. In fact,
                 on some documents, the incorrect table value resulted in a correction that was
                 close enough to actually work.





                Emulators/Debuggers

               Although  using  action  codes and logic analyzers was  the  only way  to  solve  this
                problem at the time, some emulators could have made  this task easier. With the


                System Integration and Debug                                        201
   215   216   217   218   219   220   221   222   223   224   225