QDEC — Quadrature decoder

The Quadrature decoder (QDEC) provides buffered decoding of quadrature-encoded sensor signals. It is suitable for mechanical and optical sensors.

The main features of QDEC are:

Figure 1. Quadrature decoder configuration
Quadrature decoder configuration

Sampling and decoding

The QDEC decodes the output from an incremental motion encoder by sampling the QDEC phase input pins (A and B).

The off-chip quadrature encoder is an incremental motion encoder outputting two waveforms, phase A and phase B. The two output waveforms are always 90 degrees out of phase, meaning that one always changes level before the other. The direction of movement is indicated by the waveform that changes level first. Invalid transitions may occur, meaning the two waveforms simultaneously switch. This may occur if the wheel rotates too fast relative to the sample rate set for the decoder.

The QDEC decodes the output from the off-chip encoder by sampling the QDEC phase input pins (A and B) at a fixed rate as specified in the SAMPLEPER register.

If the SAMPLEPER value needs to be changed, the QDEC shall be stopped using the STOP task. SAMPLEPER can be then changed upon receiving the STOPPED event, and QDEC can be restarted using the START task. Failing to do so may result in unpredictable behavior.

It is good practice to only change registers LEDPOL, REPORTPER, DBFEN, and LEDPRE when the QDEC is stopped.

When started, the decoder continuously samples the two input waveforms and decodes these by comparing the current sample pair (n) with the previous sample pair (n-1).

The decoding of the sample pairs is described in the table below.

Table 1. Sampled value encoding
Previous sample pair(n - 1)Current samples pair(n)SAMPLE registerACC operationACCDBL operationDescription
ABAB
00000No changeNo changeNo movement
00011IncrementNo changeMovement in positive direction
0010-1DecrementNo changeMovement in negative direction
00112No changeIncrementError: Double transition
0100-1DecrementNo changeMovement in negative direction
01010No changeNo changeNo movement
01102No changeIncrementError: Double transition
01111IncrementNo changeMovement in positive direction
10001IncrementNo changeMovement in positive direction
10012No changeIncrementError: Double transition
10100No changeNo changeNo movement
1011-1DecrementNo changeMovement in negative direction
11002No changeIncrementError: Double transition
1101-1DecrementNo changeMovement in negative direction
11101IncrementNo changeMovement in positive direction
11110No changeNo changeNo movement

LED output

The LED output follows the sample period. The LED is switched on for a set period before sampling and then switched off immediately after. The period the LED is switched on before sampling is given in the LEDPRE register.

The LED output pin polarity is specified in the LEDPOL register.

When using off-chip mechanical encoders not requiring an LED, the LED output can be disabled by writing value 'Disconnected' to the CONNECT field of the PSEL.LED register. In this case, the QDEC will not acquire access to a pin for the LED output.

Debounce filters

Each of the two-phase inputs have digital debounce filters.

When enabled through the DBFEN register, the filter inputs are sampled at a fixed 1 MHz frequency during the entire sample period (which is specified in the SAMPLEPER register). The filters require all of the samples within this sample period to equal before the input signal is accepted and transferred to the output of the filter.

As a result, only input signal with a steady state longer than twice the period specified in SAMPLEPER are guaranteed to pass through the filter. Any signal with a steady state shorter than SAMPLEPER will always be suppressed by the filter. It is assumed that the frequency during the debounce period never exceeds 500 kHz (as required by the Nyquist theorem when using a 1 MHz sample frequency).

The LED will always be ON when the debounce filters are enabled, as the inputs in this case will be sampled continuously.

When the debounce filters are enabled, displacements reported by the QDEC peripheral are delayed by one SAMPLEPER period.

Accumulators

The quadrature decoder contains two accumulator registers, ACC and ACCDBL. These registers accumulate valid motion sample values and the number of detected invalid samples (double transitions), respectively.

The ACC register accumulates all valid values (1/-1) written to the SAMPLE register. This can be useful for preventing hard real-time requirements from being enforced on the application. When using the ACC register, the application can fetch data when necessary instead of reading all SAMPLE register output. The ACC register holds the relative movement of the external mechanical device from the previous clearing of the ACC register. Sample values indicating a double transition (2) will not be accumulated in the ACC register.

An ACCOF event is generated if the ACC receives a SAMPLE value that would cause the register to overflow or underflow. Any SAMPLE value that would cause an ACC overflow or underflow will be discarded, but any samples that do not cause the ACC to overflow or underflow will still be accepted.

The accumulator ACCDBL accumulates the number of detected double transitions since the previous clearing of the ACCDBL register.

The ACC and ACCDBL registers can be cleared by the READCLRACC and subsequently read using the ACCREAD and ACCDBLREAD registers.

The ACC register can be separately cleared by the RDCLRACC and subsequently read using the ACCREAD registers.

The ACCDBL register can be separately cleared by the RDCLRDBL and subsequently read using the ACCDBLREAD registers.

The REPORTPER register allows automated capture of multiple samples before sending an event. When a non-null displacement is captured and accumulated, a REPORTRDY event is sent. When one or more double-displacements are captured and accumulated, a DBLRDY event is sent. The REPORTPER field in this register determines how many samples must be accumulated before the contents are evaluated and a REPORTRDY or DBLRDY event is sent.

Using the RDCLRACC task (manually sent upon receiving the event, or using the DBLRDY_RDCLRACC shortcut), ACCREAD can then be read.

When a double transition has been captured and accumulated, a DBLRDY event is sent. Using the RDCLRDBL task (manually sent upon receiving the event, or using the DBLRDY_RDCLRDBL shortcut), ACCDBLREAD can then be read.

Output/input pins

The QDEC uses a three-pin interface to the off-chip quadrature encoder.

These pins are acquired when the QDEC is enabled in the ENABLE register. The pins acquired by the QDEC cannot be written by the CPU, but they can still be read by the CPU.

The pin numbers used for the QDEC are selected using the PSEL.n registers.

Pin configuration

The Phase A, Phase B, and LED signals are mapped to physical pins according to the configuration specified in the PSEL.A, PSEL.B, and PSEL.LED registers respectively.

If the CONNECT field value 'Disconnected' is specified in any of these registers, the associated signal will not be connected to any physical pin. The PSEL.A, PSEL.B, and PSEL.LED registers and their configurations are only used as long as the QDEC is enabled, and retained only as long as the device is in 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 GPIO configuration before enabling peripheral before enabling the QDEC. This configuration must be retained in the GPIO for the selected I/Os 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 2. GPIO configuration before enabling peripheral
QDEC signalQDEC pinDirectionOutput valueComment
Phase AAs specified in PSEL.AInputNot applicable
Phase BAs specified in PSEL.BInputNot applicable
LEDAs specified in PSEL.LEDInputNot applicable

Registers

Instances

InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
QDEC20 : S
QDEC20 : NS
GLOBAL0x500E0000
0x400E0000
USSNANoQuadrature decoder QDEC20
QDEC21 : S
QDEC21 : NS
GLOBAL0x500E1000
0x400E1000
USSNANoQuadrature decoder QDEC21

Configuration

InstanceDomainConfiguration
QDEC20 : S
QDEC20 : NS
GLOBALUse GPIO port P1
QDEC21 : S
QDEC21 : NS
GLOBALUse GPIO port P1

Register overview

RegisterOffsetTZDescription
TASKS_START0x000Task starting the quadrature decoder
TASKS_STOP0x004Task stopping the quadrature decoder
TASKS_READCLRACC0x008Read and clear ACC and ACCDBL
TASKS_RDCLRACC0x00CRead and clear ACC
TASKS_RDCLRDBL0x010Read and clear ACCDBL
SUBSCRIBE_START0x080Subscribe configuration for task START
SUBSCRIBE_STOP0x084Subscribe configuration for task STOP
SUBSCRIBE_READCLRACC0x088Subscribe configuration for task READCLRACC
SUBSCRIBE_RDCLRACC0x08CSubscribe configuration for task RDCLRACC
SUBSCRIBE_RDCLRDBL0x090Subscribe configuration for task RDCLRDBL
EVENTS_SAMPLERDY0x100Event being generated for every new sample value written to the SAMPLE register
EVENTS_REPORTRDY0x104Non-null report ready
EVENTS_ACCOF0x108ACC or ACCDBL register overflow
EVENTS_DBLRDY0x10CDouble displacement(s) detected
EVENTS_STOPPED0x110QDEC has been stopped
PUBLISH_SAMPLERDY0x180Publish configuration for event SAMPLERDY
PUBLISH_REPORTRDY0x184Publish configuration for event REPORTRDY
PUBLISH_ACCOF0x188Publish configuration for event ACCOF
PUBLISH_DBLRDY0x18CPublish configuration for event DBLRDY
PUBLISH_STOPPED0x190Publish configuration for event STOPPED
SHORTS0x200Shortcuts between local events and tasks
INTENSET0x304Enable interrupt
INTENCLR0x308Disable interrupt
ENABLE0x500Enable the quadrature decoder
LEDPOL0x504LED output pin polarity
SAMPLEPER0x508Sample period
SAMPLE0x50CMotion sample value
REPORTPER0x510Number of samples to be taken before REPORTRDY and DBLRDY events can be generated
ACC0x514Register accumulating the valid transitions
ACCREAD0x518Snapshot of the ACC register, updated by the READCLRACC or RDCLRACC task
PSEL.LED0x51CPin select for LED signal
PSEL.A0x520Pin select for A signal
PSEL.B0x524Pin select for B signal
DBFEN0x528Enable input debounce filters
LEDPRE0x540Time period the LED is switched ON prior to sampling
ACCDBL0x544Register accumulating the number of detected double transitions
ACCDBLREAD0x548Snapshot of the ACCDBL, updated by the READCLRACC or RDCLRDBL task

TASKS_START

Address offset: 0x000

Task starting the quadrature decoder

When started, the SAMPLE register will be continuously updated at the rate given in the SAMPLEPER register.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWTASKS_START

Task starting the quadrature decoder

When started, the SAMPLE register will be continuously updated at the rate given in the SAMPLEPER register.

Trigger1Trigger task

TASKS_STOP

Address offset: 0x004

Task stopping the quadrature decoder

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWTASKS_STOPTask stopping the quadrature decoder
Trigger1Trigger task

TASKS_READCLRACC

Address offset: 0x008

Read and clear ACC and ACCDBL

Task transferring the content of ACC to ACCREAD and the content of ACCDBL to ACCDBLREAD, and then clearing the ACC and ACCDBL registers. These read-and-clear operations will be done atomically.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWTASKS_READCLRACC

Read and clear ACC and ACCDBL

Task transferring the content of ACC to ACCREAD and the content of ACCDBL to ACCDBLREAD, and then clearing the ACC and ACCDBL registers. These read-and-clear operations will be done atomically.

Trigger1Trigger task

TASKS_RDCLRACC

Address offset: 0x00C

Read and clear ACC

Task transferring the content of ACC to ACCREAD, and then clearing the ACC register. This read-and-clear operation will be done atomically.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWTASKS_RDCLRACC

Read and clear ACC

Task transferring the content of ACC to ACCREAD, and then clearing the ACC register. This read-and-clear operation will be done atomically.

Trigger1Trigger task

TASKS_RDCLRDBL

Address offset: 0x010

Read and clear ACCDBL

Task transferring the content of ACCDBL to ACCDBLREAD, and then clearing the ACCDBL register. This read-and-clear operation will be done atomically.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWTASKS_RDCLRDBL

Read and clear ACCDBL

Task transferring the content of ACCDBL to ACCDBLREAD, and then clearing the ACCDBL register. This read-and-clear operation will be done atomically.

Trigger1Trigger task

SUBSCRIBE_START

Address offset: 0x080

Subscribe configuration for task START

When started, the SAMPLE register will be continuously updated at the rate given in the SAMPLEPER register.

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that task START will subscribe to
BRWEN
Disabled0Disable subscription
Enabled1Enable subscription

SUBSCRIBE_STOP

Address offset: 0x084

Subscribe configuration for task STOP

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that task STOP will subscribe to
BRWEN
Disabled0Disable subscription
Enabled1Enable subscription

SUBSCRIBE_READCLRACC

Address offset: 0x088

Subscribe configuration for task READCLRACC

Task transferring the content of ACC to ACCREAD and the content of ACCDBL to ACCDBLREAD, and then clearing the ACC and ACCDBL registers. These read-and-clear operations will be done atomically.

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that task READCLRACC will subscribe to
BRWEN
Disabled0Disable subscription
Enabled1Enable subscription

SUBSCRIBE_RDCLRACC

Address offset: 0x08C

Subscribe configuration for task RDCLRACC

Task transferring the content of ACC to ACCREAD, and then clearing the ACC register. This read-and-clear operation will be done atomically.

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that task RDCLRACC will subscribe to
BRWEN
Disabled0Disable subscription
Enabled1Enable subscription

SUBSCRIBE_RDCLRDBL

Address offset: 0x090

Subscribe configuration for task RDCLRDBL

Task transferring the content of ACCDBL to ACCDBLREAD, and then clearing the ACCDBL register. This read-and-clear operation will be done atomically.

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that task RDCLRDBL will subscribe to
BRWEN
Disabled0Disable subscription
Enabled1Enable subscription

EVENTS_SAMPLERDY

Address offset: 0x100

Event being generated for every new sample value written to the SAMPLE register

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWEVENTS_SAMPLERDYEvent being generated for every new sample value written to the SAMPLE register
NotGenerated0Event not generated
Generated1Event generated

EVENTS_REPORTRDY

Address offset: 0x104

Non-null report ready

Event generated when REPORTPER number of samples has been accumulated in the ACC register and the content of the ACC register is not equal to 0. (Thus, this event is only generated if a motion is detected since the previous clearing of the ACC register).

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWEVENTS_REPORTRDY

Non-null report ready

Event generated when REPORTPER number of samples has been accumulated in the ACC register and the content of the ACC register is not equal to 0. (Thus, this event is only generated if a motion is detected since the previous clearing of the ACC register).

NotGenerated0Event not generated
Generated1Event generated

EVENTS_ACCOF

Address offset: 0x108

ACC or ACCDBL register overflow

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWEVENTS_ACCOFACC or ACCDBL register overflow
NotGenerated0Event not generated
Generated1Event generated

EVENTS_DBLRDY

Address offset: 0x10C

Double displacement(s) detected

Event generated when REPORTPER number of samples has been accumulated and the content of the ACCDBL register is not equal to 0. (Thus, this event is only generated if a double transition is detected since the previous clearing of the ACCDBL register).

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWEVENTS_DBLRDY

Double displacement(s) detected

Event generated when REPORTPER number of samples has been accumulated and the content of the ACCDBL register is not equal to 0. (Thus, this event is only generated if a double transition is detected since the previous clearing of the ACCDBL register).

NotGenerated0Event not generated
Generated1Event generated

EVENTS_STOPPED

Address offset: 0x110

QDEC has been stopped

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWEVENTS_STOPPEDQDEC has been stopped
NotGenerated0Event not generated
Generated1Event generated

PUBLISH_SAMPLERDY

Address offset: 0x180

Publish configuration for event SAMPLERDY

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that event SAMPLERDY will publish to
BRWEN
Disabled0Disable publishing
Enabled1Enable publishing

PUBLISH_REPORTRDY

Address offset: 0x184

Publish configuration for event REPORTRDY

Event generated when REPORTPER number of samples has been accumulated in the ACC register and the content of the ACC register is not equal to 0. (Thus, this event is only generated if a motion is detected since the previous clearing of the ACC register).

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that event REPORTRDY will publish to
BRWEN
Disabled0Disable publishing
Enabled1Enable publishing

PUBLISH_ACCOF

Address offset: 0x188

Publish configuration for event ACCOF

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that event ACCOF will publish to
BRWEN
Disabled0Disable publishing
Enabled1Enable publishing

PUBLISH_DBLRDY

Address offset: 0x18C

Publish configuration for event DBLRDY

Event generated when REPORTPER number of samples has been accumulated and the content of the ACCDBL register is not equal to 0. (Thus, this event is only generated if a double transition is detected since the previous clearing of the ACCDBL register).

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that event DBLRDY will publish to
BRWEN
Disabled0Disable publishing
Enabled1Enable publishing

PUBLISH_STOPPED

Address offset: 0x190

Publish configuration for event STOPPED

Bit number313029282726252423222120191817161514131211109876543210
IDBAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHIDX[0..255]DPPI channel that event STOPPED will publish to
BRWEN
Disabled0Disable publishing
Enabled1Enable publishing

SHORTS

Address offset: 0x200

Shortcuts between local events and tasks

Bit number313029282726252423222120191817161514131211109876543210
IDGFEDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWREPORTRDY_READCLRACCShortcut between event REPORTRDY and task READCLRACC
Disabled0Disable shortcut
Enabled1Enable shortcut
BRWSAMPLERDY_STOPShortcut between event SAMPLERDY and task STOP
Disabled0Disable shortcut
Enabled1Enable shortcut
CRWREPORTRDY_RDCLRACCShortcut between event REPORTRDY and task RDCLRACC
Disabled0Disable shortcut
Enabled1Enable shortcut
DRWREPORTRDY_STOPShortcut between event REPORTRDY and task STOP
Disabled0Disable shortcut
Enabled1Enable shortcut
ERWDBLRDY_RDCLRDBLShortcut between event DBLRDY and task RDCLRDBL
Disabled0Disable shortcut
Enabled1Enable shortcut
FRWDBLRDY_STOPShortcut between event DBLRDY and task STOP
Disabled0Disable shortcut
Enabled1Enable shortcut
GRWSAMPLERDY_READCLRACCShortcut between event SAMPLERDY and task READCLRACC
Disabled0Disable shortcut
Enabled1Enable shortcut

INTENSET

Address offset: 0x304

Enable interrupt

Bit number313029282726252423222120191817161514131211109876543210
IDEDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARW
W1S
SAMPLERDYWrite '1' to enable interrupt for event SAMPLERDY
Set1Enable
Disabled0Read: Disabled
Enabled1Read: Enabled
BRW
W1S
REPORTRDY

Write '1' to enable interrupt for event REPORTRDY

Event generated when REPORTPER number of samples has been accumulated in the ACC register and the content of the ACC register is not equal to 0. (Thus, this event is only generated if a motion is detected since the previous clearing of the ACC register).

Set1Enable
Disabled0Read: Disabled
Enabled1Read: Enabled
CRW
W1S
ACCOFWrite '1' to enable interrupt for event ACCOF
Set1Enable
Disabled0Read: Disabled
Enabled1Read: Enabled
DRW
W1S
DBLRDY

Write '1' to enable interrupt for event DBLRDY

Event generated when REPORTPER number of samples has been accumulated and the content of the ACCDBL register is not equal to 0. (Thus, this event is only generated if a double transition is detected since the previous clearing of the ACCDBL register).

Set1Enable
Disabled0Read: Disabled
Enabled1Read: Enabled
ERW
W1S
STOPPEDWrite '1' to enable interrupt for event STOPPED
Set1Enable
Disabled0Read: Disabled
Enabled1Read: Enabled

INTENCLR

Address offset: 0x308

Disable interrupt

Bit number313029282726252423222120191817161514131211109876543210
IDEDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARW
W1C
SAMPLERDYWrite '1' to disable interrupt for event SAMPLERDY
Clear1Disable
Disabled0Read: Disabled
Enabled1Read: Enabled
BRW
W1C
REPORTRDY

Write '1' to disable interrupt for event REPORTRDY

Event generated when REPORTPER number of samples has been accumulated in the ACC register and the content of the ACC register is not equal to 0. (Thus, this event is only generated if a motion is detected since the previous clearing of the ACC register).

Clear1Disable
Disabled0Read: Disabled
Enabled1Read: Enabled
CRW
W1C
ACCOFWrite '1' to disable interrupt for event ACCOF
Clear1Disable
Disabled0Read: Disabled
Enabled1Read: Enabled
DRW
W1C
DBLRDY

Write '1' to disable interrupt for event DBLRDY

Event generated when REPORTPER number of samples has been accumulated and the content of the ACCDBL register is not equal to 0. (Thus, this event is only generated if a double transition is detected since the previous clearing of the ACCDBL register).

Clear1Disable
Disabled0Read: Disabled
Enabled1Read: Enabled
ERW
W1C
STOPPEDWrite '1' to disable interrupt for event STOPPED
Clear1Disable
Disabled0Read: Disabled
Enabled1Read: Enabled

ENABLE

Address offset: 0x500

Enable the quadrature decoder

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
A-RWENABLE

Enable or disable the quadrature decoder

When enabled the decoder pins will be active. When disabled the quadrature decoder pins are not active and can be used as GPIO .

Disabled0Disable
Enabled1Enable

LEDPOL

Address offset: 0x504

LED output pin polarity

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWLEDPOLLED output pin polarity
ActiveLow0Led active on output pin low
ActiveHigh1Led active on output pin high

SAMPLEPER

Address offset: 0x508

Sample period

Bit number313029282726252423222120191817161514131211109876543210
IDAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWSAMPLEPERSample period. The SAMPLE register will be updated for every new sample
128us0128 µs
256us1256 µs
512us2512 µs
1024us31024 µs
2048us42048 µs
4096us54096 µs
8192us68192 µs
16384us716384 µs
32ms832768 µs
65ms965536 µs
131ms10131072 µs

SAMPLE

Address offset: 0x50C

Motion sample value

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSAMPLE[-1..2]

Last motion sample

The value is a 2's complement value, and the sign gives the direction of the motion. The value '2' indicates a double transition.

REPORTPER

Address offset: 0x510

Number of samples to be taken before REPORTRDY and DBLRDY events can be generated

Bit number313029282726252423222120191817161514131211109876543210
IDAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWREPORTPER

Specifies the number of samples to be accumulated in the ACC register before the REPORTRDY and DBLRDY events can be generated.

The report period in [µs] is given as: RPUS = SP * RP, where RPUS is the report period in [µs/report], SP is the sample period in [µs/sample] specified in SAMPLEPER, and RP is the report period in [samples/report] specified in REPORTPER .

10Smpl010 samples/report
40Smpl140 samples/report
80Smpl280 samples/report
120Smpl3120 samples/report
160Smpl4160 samples/report
200Smpl5200 samples/report
240Smpl6240 samples/report
280Smpl7280 samples/report
1Smpl81 sample/report

ACC

Address offset: 0x514

Register accumulating the valid transitions

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARACC[-1024..1023]

Register accumulating all valid samples (not double transition) read from the SAMPLE register.

Double transitions ( SAMPLE = 2 ) will not be accumulated in this register. The value is a 32 bit 2's complement value. If a sample that would cause this register to overflow or underflow is received, the sample will be ignored and an overflow event ( ACCOF ) will be generated. The ACC register is cleared by triggering the READCLRACC or the RDCLRACC task.

ACCREAD

Address offset: 0x518

Snapshot of the ACC register, updated by the READCLRACC or RDCLRACC task

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARACCREAD[-1024..1023]

Snapshot of the ACC register.

The ACCREAD register is updated when the READCLRACC or RDCLRACC task is triggered.

PSEL.LED

Address offset: 0x51C

Pin select for LED signal

Bit number313029282726252423222120191817161514131211109876543210
IDCBBBAAAAA
Reset 0xFFFFFFFF11111111111111111111111111111111
IDR/WFieldValue IDValueDescription
ARWPIN[0..31]Pin number
BRWPORT[0..7]Port number
CRWCONNECTConnection
Disconnected1Disconnect
Connected0Connect

PSEL.A

Address offset: 0x520

Pin select for A signal

Bit number313029282726252423222120191817161514131211109876543210
IDCBBBAAAAA
Reset 0xFFFFFFFF11111111111111111111111111111111
IDR/WFieldValue IDValueDescription
ARWPIN[0..31]Pin number
BRWPORT[0..7]Port number
CRWCONNECTConnection
Disconnected1Disconnect
Connected0Connect

PSEL.B

Address offset: 0x524

Pin select for B signal

Bit number313029282726252423222120191817161514131211109876543210
IDCBBBAAAAA
Reset 0xFFFFFFFF11111111111111111111111111111111
IDR/WFieldValue IDValueDescription
ARWPIN[0..31]Pin number
BRWPORT[0..7]Port number
CRWCONNECTConnection
Disconnected1Disconnect
Connected0Connect

DBFEN

Address offset: 0x528

Enable input debounce filters

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWDBFENEnable input debounce filters
Disabled0Debounce input filters disabled
Enabled1Debounce input filters enabled

LEDPRE

Address offset: 0x540

Time period the LED is switched ON prior to sampling

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAA
Reset 0x0000001000000000000000000000000000010000
IDR/WFieldValue IDValueDescription
ARWLEDPRE[1..511]Period in µs the LED is switched on prior to sampling

ACCDBL

Address offset: 0x544

Register accumulating the number of detected double transitions

Bit number313029282726252423222120191817161514131211109876543210
IDAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARACCDBL[0..15]

Register accumulating the number of detected double or illegal transitions. ( SAMPLE = 2 ).

When this register has reached its maximum value, the accumulation of double/illegal transitions will stop. An overflow event (ACCOF) will be generated if any double or illegal transitions are detected after the maximum value was reached. This field is cleared by triggering the READCLRACC or RDCLRDBL task.

ACCDBLREAD

Address offset: 0x548

Snapshot of the ACCDBL, updated by the READCLRACC or RDCLRDBL task

Bit number313029282726252423222120191817161514131211109876543210
IDAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARACCDBLREAD[0..15]Snapshot of the ACCDBL register. This field is updated when the READCLRACC or RDCLRDBL task is triggered.