9 Summary

The choice between polling and interrupts depends heavily on the application requirements, however, it is possible to follow a few guidelines.

First, if your product is battery powered or otherwise power restricted, avoid polling. Polling requires the CPU to stay in Active mode, potentially consuming a lot more power than an interrupt driven system. However, if increased power consumption is not an issue, and only one or two status bits need checking, polling is very easy to implement in software.

Second, it can be difficult to manage and maintain a complex application in an effective and predictable way. This is made easier with the available interrupt priority schemes and the possibility to elevate one interrupt to a higher priority level.

Third, if an application is restricted in code size, this can be reduced by using the compact vector table. In some cases, it could be advantageous to use a compact vector table only for the bootloader and then switch back to the full-size table in the application section. This could potentially reduce boot section size, leaving more space for the application section.

As shown in this application note, the new tinyAVR 0- and 1-series, and megaAVR 0-series MCUs offer powerful flow control features with respect to interrupt handling. This allows designers to customize power consumption and responsiveness to fit their design requirements.