Page 144 - Understanding Automotive Electronics
P. 144
2735 | CH 4 Page 131 Tuesday, March 10, 1998 11:06 AM
MICROCOMPUTER INSTRUMENTATION AND CONTROL 4
Figure 4.20
Analog Output
Voltage versus
Sampling Rate
FPO
Conversion time can be a serious limitation when slow converters are
used. The microcomputer cannot afford to waste time waiting while the
converter works. This is especially true when the microcomputer is used to
control and monitor many systems at the same time. Instead of waiting for the
ADC to finish, the computer could be off running another part of the program
and come back only when the conversion is done. But how will the computer
know when the conversion is finished?
Polling is used in some One way of doing this is for the microcomputer to periodically check the
microcomputers to peri- interface while it is running another part of the program. This method is called
odically check the ADC polling. A subroutine is included in the main program and is called up
interface rather than whenever an ADC interface is being used. This usually consists of a few lines of
waiting in an idle state assembly language code that checks to see if the interface is done and collects
for the ADC to do the the result when it is finished. When the polling subroutine determines that the
conversion. ADC is finished, the main program continues without using the polling
subroutine until the ADC interface is called up again. The problem with such a
scheme is that the polling routine may be called many times before the interface
is finished. This can waste the computer’s time and slow it down. Therefore, an
evaluation must be made in certain systems to determine if polling is
worthwhile.
UNDERSTANDING AUTOMOTIVE ELECTRONICS 131