Subscribe to EDN
RSS
Reprints/License
Print
Email

Software avoids interrupt overhead

Hans-Herbert Kirste, WAGO Kontakttechnik GmbH, Minden, Germany -- EDN, March 2, 2000

You can service peripheral ICs connected to a µC by polling or via interrupts. The polling method can be time-consuming, so interrupt handling is often preferable because the µC has to take care of the peripheral only on request. However, each separate interrupt causes the µC to stop normal program execution, save its current state on the system stack, and vector to the interrupt's processing function. The first instructions in the interrupt function normally push some or all registers used onto the stack.

Peripherals, such as the 16550 UART, that have more than one interrupt source, may require that the µC process more than one request at a time. Fortunately, you can write software that allows the µC to process more than one request in one interrupt cycle. Thus, the interrupt overhead occurs only once. The result is improved system performance.

Listing 1 is an example of standard interrupt-handling software. Standard practice involves vectoring, pushing, and popping registers for each interrupt request. A more sophisticated function in Listing 2 tries to handle as many interrupt requests as the peripheral requires. This function processes multiple reads to the identification register, and the process repeats until the µC has serviced all sources. (DI #2489)


RSS
Reprints/License
Print
Email
Talkback
Canon Resource Center

Featured Company


Most Recent Resources

Advertisement
Related Content

No related content found.

  • 0 rated items found.
Advertisement

KNOWLEDGE CENTER

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
Engineering Careers
Jobs sponsored by
Advertisement
About EDN   |   Site Map   |   Contact Us   |   Subscription   |   RSS
© 2012 UBM Electronics. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other UBM Canon sites

UBM Canon | Design News | Test & Measurement World | Packaging Digest | EDN | Qmed | Pharmalive | Appliance Magazine | Plastics Today | Powder Bulk Solids | Canon Trade Shows