Nations Technologies Inc.
Tel
:
+86-755-86309900
:
info@nationstech.com
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
302
/
631
be maintained to its reset value which is equal to ‘0’. Also, the prescaler division ratio must be equal to its reset
value which is 1 (LPTIM_CFG.CLKPRE[2:0] bits must be ‘000’).
Figure 13-7 Encoder mode counting sequence
Non-orthogonal encoder mode
This mode allows handling signals from non-quadrature encoders, which is used to detect sub-sequent positive pulses
from external interface. Non-Encoder interface mode acts simply as an external clock with direction selection. This
means that the counter just counts continuously between 0 and the auto-reload value programmed into the
LPTIM_ARR register (0 up to ARR or ARR down to 0 depending on the direction). Therefore you must configure
LPTIM_ARR before starting. From the two external input signals, Input1 and Input2, a clock signal is generated to
clock the LPTIM counter. The order between those two signals determines the counting direction.
The Non-Encoder mode is only available when the LPTIM is clocked by an internal clock source. The signals
frequency on both Input1 and Input2 inputs must not exceed the LPTIM internal clock frequency divided by 4. This
is mandatory in order to guarantee a proper operation of the LPTIM.
Direction change is signalized by the two Down and Up flags in the LPTIM_INTSTS register. Also, an interrupt can
be generated for both direction change events if enabled through the LPTIM_INTEN register.
To activate the Non-Encoder mode the LPTIM_CFG.NENC bit has to be set to ‘1’. The LPTIM must first be
Up
Down
Up
T1
T2
Coutnter