CY8C28xxx PSoC Programmable System-on-Chip TRM, Document No. 001-52594 Rev. *G
75
General Purpose I/O (GPIO)
6.1.4
GPIO Block Interrupts
Each GPIO block can be individually configured for interrupt
capability. Blocks are configured by pin interrupt enables
and also by selection of the interrupt state. Blocks can be
set to interrupt when the pin is high, low, or when it changes
from the last time it was read. The block provides an open-
drain interrupt output (INTO) that is connected to other
GPIO blocks in a wire-OR fashion.
All pin interrupts that are wire-ORed together are tied to the
same system GPIO interrupt. Therefore, if interrupts are
enabled on multiple pins, the user’s interrupt service routine
must provide a mechanism to determine which pin was the
source of the interrupt.
Using a GPIO interrupt requires the following steps:
1. Set the Interrupt mode in the GPIO pin block.
2. Enable the bit interrupt in the GPIO block.
3. Set the mask bit for the (global) GPIO interrupt.
4. Assert the overall Global Interrupt Enable.
The first two steps, bit interrupt enable and Interrupt mode,
are set at the GPIO block level (that is, at each port pin), by
way of the block’s configuration registers.
The last two steps are common to all interrupts and are
described in the
Interrupt Controller chapter on page 65
.
At the GPIO block level, asserting the INTO line depends
only on the bit interrupt enable and the state of the pin rela-
tive to the chosen Interrupt mode. At the PSoC device level,
due to their wire-OR nature, the GPIO interrupts are neither
true edge-sensitive interrupts nor true level-sensitive inter-
rupts. They are considered edge-sensitive for asserting, but
level-sensitive for release of the wire-OR interrupt line.
If no GPIO interrupts are asserting, a GPIO interrupt will
occur whenever a GPIO pin interrupt enable is set and the
GPIO pin transitions, if not already transitioned, appropri-
ately high or low, to match the interrupt mode configuration.
When this happens, the INTO line will pull low to assert the
GPIO interrupt. This assumes the other system-level
enables are on, such as setting the global GPIO interrupt
enable and the Global Interrupt Enable. Setting the pin inter-
rupt enable may immediately assert INTO, if the Interrupt
mode conditions are already being met at the pin.
After INTO pulls low, it will continue to hold INTO low until
one of these conditions changes.
■
The pin interrupt enable is cleared
■
The voltage at pin transitions to the opposite state
■
In interrupt-on-change mode, the GPIO data register is
read, thus setting the local interrupt level to the opposite
state
■
The Interrupt mode is changed so that the current pin
state does not create an interrupt
When one of these conditions is met, the INTO releases. At
this point, another GPIO pin (or this pin again) can assert its
INTO pin, pulling the common line low to assert a new inter-
rupt.
Note that the GPIO data register state is latched during read
operation. Interrupt-on-change may not behave as expected
if the input signal changes during the metastability time of
the latch, that is, when the GPIO is being read.
Note the following behavior from this level-release feature. If
one pin is asserting INTO and then a second pin asserts its
INTO, when the first pin releases its INTO, the second pin is
already driving INTO and thus no change is seen (that is, no
new interrupt is asserted on the GPIO interrupt). Care must
be taken, using polling or the states of the GPIO pin and
Global Interrupt Enables, to catch all interrupts among a set
of wire-OR GPIO blocks.
shows the interrupt logic portion of the block.
Figure 6-2. GPIO Interrupt Logic Diagram
Low
PRTxIE:n
High
Change
D Q
S
R
INTO
INBUF
CELLRD
EN
QinLatch
Interrupt Mode
PRTxIC0:n
PRTxIC1:n
Output
0
0
Disabled
0
1
Low
1
0
High
1
1
Change from last read
Vss
PRTxIC1:n
PRTxIC0:n
PRTxIC1:n
PRTxIC0:n
PRTxIC1:n
PRTxIC0:n
Содержание CY8C28 series
Страница 65: ...64 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G RAM Paging ...
Страница 85: ...84 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Internal Main Oscillator IMO ...
Страница 93: ...92 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G External Crystal Oscillator ECO ...
Страница 97: ...96 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Phase Locked Loop PLL ...
Страница 125: ...124 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Страница 311: ...310 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G IDAC_CR0 1 FDh ...
Страница 317: ...316 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Страница 393: ...392 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Страница 425: ...424 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Analog Reference ...
Страница 461: ...460 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Two Column Limited Analog System ...
Страница 477: ...476 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Digital Clocks ...
Страница 483: ...482 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Multiply Accumulate MAC ...
Страница 513: ...512 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Internal Voltage Reference ...
Страница 523: ...522 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Switch Mode Pump SMP ...
Страница 533: ...532 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G I O Analog Multiplexer ...
Страница 537: ...536 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Real Time Clock RTC ...
Страница 561: ...560 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...