15.3.1.2 Edge Detection and Clock Domains
Using EDSEL in PRS_CHx_CTRL, edge detection can be applied to a PRS signal. When edge detection is enabled, changes in the
PRS input will result in a pulse on the PRS channel. This requires that the ASYNC bit in PRS_CHx_CTRL is cleared. Signals on the
PRS input must be at least one HFCLK period wide in order to be detected properly. This applies to all cases when ASYNC is not used
in the PRS.
For communication between peripherals on different prescaled clocks (e.g. between peripherals on HFCLK and HFPERCLK), there are
two options. One option is to use level signals. No additional action is needed for level signals, but software must make sure that the
level signals are held long enough for the destination domain to detect them. The other option is to use pulse signals. For pulse signals,
edge detection should be enabled (by configuring EDSEL in PRS_CHx_CTRL to positive edge, negative edge, or both) and STRETCH
in PRS_CHx_CTRL should be set. When edge detection and stretch are enabled on a PRS source, the output on the PRS channel is
held long enough for the destination domain to detect the pulse. This also works if there are multiple destination domains running at
different frequencies.
15.3.1.3 Configurable PRS Logic
Each PRS channel has three logic functions that can be used by themselves or in combination. The selected PRS source can be
AND'ed with the next PRS channel output, OR'ed with the previous PRS channel output and inverted. This is shown in
. The order of the functions is important. If OR and AND are enabled at the same time, AND is applied first, and
then OR. Note that the previous and next channel options wrap around. Using the ORPREV option on the first PRS channel OR's with
the output of the last PRS channel. Likewise, using the ANDNEXT option on the last PRS channel AND's with the output of the first
PRS channel.
Signals from
producer
peripherals
PRS[i-1]
PRS[i+1]
PRS[0]
PRS[N-1]
ANDNEXT
ORPREV
INV
PRS[i]
Figure 15.2. Configurable PRS Logic
In addition to the logic functions that can combine a PRS channel with one of its neighbors, a PRS channel can also select any other
PRS channel as input. This can allow relatively complex logic functions to be created.
15.3.2 Producers
Through SOURCESEL in PRS_CHx_CTRL, each PRS channel selects signal producers. Each producer outputs one or more signals
which can be selected by setting the SIGSEL field in PRS_CHx_CTRL. Setting the SOURCESEL bits to 0 (Off) leads to a constant 0
output from the input mux. An overview of the available producers can be found in the SOURCESEL and SIGSEL fields in
PRS_CHx_CTRL. Note that GPIO producers are selected in the GPIO module using the edge interrupt configuration settings described
in
32.3.5.1 Edge Interrupt Generation
. GPIOPIN0 uses the selection for the EXTI0 interrupt, GPIOPIN1 uses the selection for the EXTI1
interrupt, and so on.
Reference Manual
PRS - Peripheral Reflex System
silabs.com
| Building a more connected world.
Rev. 1.1 | 422