
192 Embedded systems design
To convert the previous example to one using interrupts, all
the polling and data port code is removed from the background
analysis software. The data transfer code is written as part of the
interrupt service routine (ISR) associated with the interrupt gen-
erated by the data port hardware. When the port receives a byte of
data, it generates an interrupt. This activates the ISR which proc-
esses the data before handing execution back to the background
task. The beauty of this type of operation is that the background
task can be written independently of the data port code and that
the whole timing of the system is now moved ...