Product Specs

Table Of Contents
36 QDEC Quadrature decoder
Page
350
ON mode. When the peripheral is disabled, the pins will behave as regular GPIOs, and use the configuration
in their respective OUT bit field and PIN_CNF[n] register.
To secure correct behavior in the QDEC, the pins used by the QDEC must be configured in the GPIO
peripheral as described in Table 84: GPIO configuration before enabling peripheral on page 350 before
enabling the QDEC. This configuration must be retained in the GPIO for the selected IOs as long as the
QDEC is enabled.
Only one peripheral can be assigned to drive a particular GPIO pin at a time. Failing to do so may result in
unpredictable behavior.
Table 84: GPIO configuration before enabling peripheral
QDEC signal
QDEC pin
Direction
Output value Comment
Phase A
As specified in PSEL.A
Input
Not applicable
Phase B
As specified in PSEL.B
Input
Not applicable
LED
As specified in PSEL.LED
Input
Not applicable
36.7 Registers
Table 85: Instances
Base address Peripheral
Instance
Description
Configuration
0x40012000 QDEC
QDEC
Quadrature decoder
Table 86: Register Overview
Register
Offset
Description
TASKS_START
0x000
Task starting the quadrature decoder
TASKS_STOP
0x004
Task stopping the quadrature decoder
TASKS_READCLRACC
0x008
Read and clear ACC and ACCDBL
TASKS_RDCLRACC
0x00C
Read and clear ACC
TASKS_RDCLRDBL
0x010
Read and clear ACCDBL
EVENTS_SAMPLERDY
0x100
Event being generated for every new sample value written to the SAMPLE register
EVENTS_REPORTRDY
0x104
Non-null report ready
EVENTS_ACCOF
0x108
ACC or ACCDBL register overflow
EVENTS_DBLRDY
0x10C
Double displacement(s) detected
EVENTS_STOPPED
0x110
QDEC has been stopped
SHORTS
0x200
Shortcut register
INTENSET
0x304
Enable interrupt
INTENCLR
0x308
Disable interrupt
ENABLE
0x500
Enable the quadrature decoder
LEDPOL
0x504
LED output pin polarity
SAMPLEPER
0x508
Sample period
SAMPLE
0x50C
Motion sample value
REPORTPER
0x510
Number of samples to be taken before REPORTRDY and DBLRDY events can be generated
ACC
0x514
Register accumulating the valid transitions
ACCREAD
0x518
Snapshot of the ACC register, updated by the READCLRACC or RDCLRACC task
PSEL.LED
0x51C
Pin select for LED signal
PSEL.A
0x520
Pin select for A signal
PSEL.B
0x524
Pin select for B signal
DBFEN
0x528
Enable input debounce filters
LEDPRE
0x540
Time period the LED is switched ON prior to sampling
ACCDBL
0x544
Register accumulating the number of detected double transitions
ACCDBLREAD
0x548
Snapshot of the ACCDBL, updated by the READCLRACC or RDCLRDBL task
36.7.1 SHORTS
Address offset: 0x200
Shortcut register