C251 User's Guide

Tips for Interrupts

To enable an interrupt source you need to set global interrupt enable all (EA) bit in the SFR register IE0. In addition, each individual interrupt source has it is own interrupt enable bit which must be set to 1.

Several interrupt routines with the same interrupt priority can share a common registerbank. However you cannot state using 0, since this registerbank is typically used in the main function.

If you need to disable interrupts for a C statement or a C function you can use the following methods:

  • To disable interrupts for a complete C function you can use the #pragma disable compiler directive. Refer to DISABLE for more information.
  • You may reset the EA bit in the IE0 SFR register.