IP2022 User’s Manual—Peripherals www.ubicom.com 237 1. Configure the port pins used for interrupts as inputs by pro-
gramming the RBDIR register.
2. Select the desired edge for triggering the interrupt by pro-
gramming the INTED register. This may set interrupt flags.
Be  sure  all  enabled  interrupt pins are  driven to valid logic
levels, not floating.
3. Clear the interrupt flags in the INTF register. 4. Enable  the  interrupt  input(s)  by  setting  the  corresponding
bit(s) in the INTE register.
5. Set the GIE bit. Figure  4-2  shows  the  Port  B  interrupt  logic.  Port  B  has  three
registers  for  supporting  external  interrupts,  the  INTED  (Section
4.1.6), INTF (Section 4.1.7), and INTE (Section 4.1.8) registers.
The  INTED  register  controls  the  logic  which  selects  the  edge
sensitivity (i.e. rising or falling edge) of the Port B pins. When an
edge of the selected type occurs, the corresponding flag in the
INTF register is set, whether or not the interrupt is enabled. The
interrupt  signal  passed  to  the  system  interrupt  logic  is  the  OR
function of the AND of each interrupt flag in the INTF register with
its corresponding enable bit in the INTE register.