
EXTERNAL INTERRUPTS
Chapter 4 External Interrupt Examples
MCU-AN -300203-E-V17
- 14 -
© Fujitsu Microelectronics Europe GmbH
4.2.2 External Interrupts and DMA
The user has to take special care when using DMA transfer triggered by an External
Interrupt pin connected to disturbed signal source (as explained before in the section 4.2).
During the bouncing time of the switch, multiple DMA transfers can happen which is not
desired. The DMA as such is not able to disable the interrupts during this bouncing time, so
the software debounce mechanism discussed in section 4.2 cannot be realized in this case.
Hence it is required to use the capacitor (hardware debounce) circuit as shown in Figure 2-2.
By using the same, the bouncing of the switch is eliminated at the hardware level itself and
the clean signal (without noise) would appear at the external interrupt pin.
4.3 External Interrupts and Wake Up from Stop Mode
4.3.1 Example I
The following example shows, that External Interrupts can be used to request a stop mode
and can wake up the MCU from this mode.
External Interrupt 0 is used to wake up the MCU and External Interrupt 1 is used to request a
stop mode. Before stop mode “
0x0F
“ is written to Port00, during run mode this Port is
counting.
/* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU */
/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */
/* ELIGIBILITY FOR ANY PURPOSES. */
/* (C) Fujitsu Microelectronics Europe GmbH */
/*---------------------------------------------------------------------------*/
// initialise external int 0
void
Init_extint0 (
void
)
{
ADER2_ADE16 = 0;
// select IO mode
PIER07_IE0 = 1;
ENIR0_EN0 = 0;
// disable ext int 0
ELVR0_LA0 = 1;
ELVR0_LB0 = 1;
// LB0,LA0 = 11 -> falling edge
}
// initialise external int 1
void
Init_extint1 (
void
)
{
ADER2_ADE17 = 0;
// select IO mode
PIER07_IE1 = 1;
ENIR0_EN1 = 0;
// disable interrupt request
ELVR0_LA1 = 1;
ELVR0_LB1 = 1;
// LB1,LA1 = 11 -> falling edge
}
P