Programming Examples
4-24
ADSP-BF537 Blackfin Processor Hardware Reference
Listing 4-1. Servicing GPIO Interrupt Request
#include <defBF537.h>
.section program;
_portg_a_isr:
/* push used registers */
[--sp] = (r7:7, p5:5);
/* clear interrupt request on GPIO pin PG2 */
/* no matter whether used A or B channel */
p5.l = lo(PORTGIO_CLEAR);
p5.h = hi(PORTGIO_CLEAR);
r7 = PG2;
w[p5] = r7;
/* place user code here */
/* sync system, pop registers and exit */
ssync;
(r7:7, p5:5) = [sp++];
rti;
_portg_a_isr.end:
The W1C instruction shown in this example may require several
SCLK
cycles to complete, depending on system load and instruction history. The
program sequencer does not wait until the instruction completes and con-
tinues program execution immediately. The
SSYNC
instruction ensures that
the W1C command indeed cleared the request in the GPIO peripheral
before the
RTI
instruction executes. However, the
SSYNC
instruction does
not guarantee that the release of interrupt request has also been recognized
by the CEC controller, which may require a few more
CCLK
cycles depend-
ing on the
CCLK
-to-
SCLK
ratio. In service routines consisting of a few
instructions only, two
SSYNC
instructions are recommended between the
clear command and the
RTI
instruction. However, one
SSYNC
instruction
is typically sufficient if the clear command performs in the very beginning
Summary of Contents for Blackfin ADSP-BF537
Page 42: ...Contents xlii ADSP BF537 Blackfin Processor Hardware Reference ...
Page 90: ...Development Tools 1 32 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 138: ...Programming Examples 4 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 340: ...SDC Programming Examples 6 84 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 606: ...Programming Examples 9 94 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 660: ...Programming Examples 10 54 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 720: ...Electrical Specifications 11 60 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 840: ...Programming Examples 13 42 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 876: ...Programming Examples 14 36 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 938: ...Programming Examples 15 62 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 958: ...Programming Examples 17 12 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 986: ...Programming Examples 18 28 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1162: ...G 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1218: ...Index I 56 ADSP BF537 Blackfin Processor Hardware Reference ...