Quadrature Decoder (Q-Decoder)
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
461
Bit
Name
Access
Default
Description
31:17
RSVD
N/A
--
Reserved
16:12
SMP_DIV
R/W
0x0
Divider for input signal sampling clock
Sampling Clock = source-clock / (s 1)
11
RSVD
N/A
--
Reserved
10:0
DBN_TM
R/W
0
Debounce timer configuration
The debounce time period is DBN_TM * one sampling clock time, sampling
clock can be a 32.768KHz or 2MHz clock.
21.3.1.2
REG_CTRL
Name
: Q-Decoder Control Register
Size
: 32 bits
Address offset
: 0x0004
Read/write access
: read/write
31
30
29
28
27
26
25
24
AXIS_EN
PC_RST
RC_RST
RC_MOD
QALL_RST
RSVD
RC_INT_EN
R/W
R/W
R/W
R/W
R/W
R/W
23
22
21
20
19
18
17
16
PCE_INT_EN
IDX_INT_EN
RUF_INT_EN
ROF_INT_EN
PC_INT_EN
DR_INT_EN
CT_INT_EN
OF_INT_EN
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
15
14
13
12
11
10
9
8
UF_INT_EN
IL_INT_EN
CNT_SC
DBN_EN
RSVD
R/W
R/W
R/W
R/W
7
6
5
4
3
2
1
0
RSVD
PCHG_LV
MNU_INI
INI_PHASE
R/W
R/W
R/W
Bit
Name
Access
Default Description
31
AXIS_EN
R/W
0
Quadrature decoder enable control
1: Enable
0: Disable
When the CPU writes 0 (disable) to this bit, hardware works as follows:
Source clock is gated.
Clear all interrupt status.
30
PC_RST
R/W
0
Position counter reset
0: Position counter is not in reset state (normal active).
1: Writing 1 to this bit resets the position counter to 0.
The position counter reset can only be performed when the Q-decoder is disabled (AXIS_EN =
0). Writing 1 to this bit while the Q-decoder is enabled (AXIS_EN = 1) doesn’t reset the position
counter.
29
RC_RST
R/W
0
Rotation counter reset
0: Rotation counter is not in reset state.
1: Writing 1 to this bit resets the rotation counter to 0.
The rotation counter reset can only be performed when Q-decoder is disabled (AXIS_EN = 0).
Writing 1 to this bit while Q-decoder is enabled doesn’t reset the rotation counter.
28
RC_MOD
R/W
0
Rotation counter mode
0: The rotation counter is used to accumulate the number of index event occurred with
direction (+/-). The criterion of determining an index event occurrence is the same as the
index reset according to auto reset or index reset setting.
1: The rotation counter is used to accumulate the number of the position counter
overflow (+)/underflow (-).
27
QALL_RST
R/W
0
Quadrature decoder all reset
0: Quadrature decoder is not in reset state.
1: Writing 1 to this bit resets the state machine and resets all functions.
The Q-decoder reset can only be performed when the Q-decoder is disabled.
Realtek confidential files
The document authorized to
SZ99iot
2019-05-15 10:08:03