User manual

...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 623
www.energymicro.com
Upon a state transition, LESENSE can generate a pulse on one or more of the decoder PRS channels.
Which channel to generate a pulse on is configured in the PRSACT bit field. If PRSCNT in DECCTRL
is set, count signals will be generated on decoder PRS channels 0 and 1 according to the PRSACT
configuration. In this mode, channel 0 will pulse each time a count event occurs while channel 1 indicates
the count direction, 1 being up and 0 being down. The count direction will be kept at its previous state
in between count events. The EFM32GG pulse counter may be used to keep track of events based on
these PRS outputs.
If SETIF is set, the DECODER interrupt flag will be set when the transition occurs. If INTMAP in
DECCTRL and SETIF is set, a transition from state x will set the CHx interrupt flag in addition to the
DECODER flag.
Setting CHAIN in STx_TCONFA enables the decoder to evaluate more than two possible transitions for
each state. If none of the transitions defined in STx_TCONFA or STx_TCONFB matches, the decoder
will jump to the next descriptor pair and evaluate the transitions defined there. The decoder uses two
LFACLK
LESENSE
cycles for each descriptor pair to be evaluated. If ERRCHK in CTRL is set, the decoder
will check that the sensor state has not changed if none of the defined transitions match. The DECERR
interrupt flag will be set if none of the transitions match and the sensor state has changed. Figure 25.7 (p.
623) illustrates state transitions. The "Generate PRS signals and set interrupt flag" blocks will perform
actions according to the configuration in STx_TCONFA and STx_TCONFB.
Figure 25.7. Decoder state transition evaluation
ST
i
+ 1
_TCONF
ST
i
_
TCONF
STATE
i
NEXTSTATE
Ai
NEXTSTATE
Bi
NEXTSTATE
Ai+ 1
NEXTSTATE
Bi+ 1
Generate PRS
signals and set
interrupt flag
Generate PRS
signals and set
interrupt flag
Generate PRS
signals and set
interrupt flag
Generate PRS
signals and set
interrupt flag
Set DECERR
interrupt flag
SENSORSTATE & ~ MASK
Ai
=
COMP
Ai
& ~ MASK
Ai
Y N
SENSORSTATE & ~ MASK
Bi
=
COMP
Bi
& ~ MASK
Bi
Y N
CHAIN
i
= 1
Y N
SENSORSTATE & ~ MASK
Ai+ 1
=
COMP
Ai+ 1
& ~ MASK
Ai+ 1
Y N
SENSORSTATE & ~ MASK
Bi+ 1
=
COMP
Bi+ 1
& ~ MASK
Bi+ 1
Y N
SENSORSTATE changed & &
ERRCHK= 1
Y N
CHAIN
i+ 1
= 1
Y N