Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
196
/
631
Figure 10-33 Encoder interface mode example with IC1FP1 polarity inverted
Interfacing with Hall sensor
Connect the Hall sensor to the three input pins (CC1, CC2 and CC3) of the timer, and then select the XOR function
to pass the inputs of TIMx_CH1, TIMx_CH2 and TIMx_CH3 through the XOR gate as the output of TI1 to channel
1 for capture signal.
The timer needs to be configured as the reset mode in slave mode (TIMx_SMCTRL.SMSEL= ‘100’); the edge of the
trigger select TI1 triggers TI1F_ED (TIMx_SMCTRL.TSEL= ‘100’), any change in the Hall 3 inputs will trigger the
counter to recount, so it is used as a time reference; the capture/compare channel 1 is configured to capture the TRC
signal in capture mode (TIMx_CCMOD1.CC1SEL= ‘11’), which is used to calculate the two input time intervals,
thereby reflecting the motor speed.
Select timer channel 2 to output pulses to the advanced timer to trigger the COM event of the advanced timer to
update the control bits of the output PWM. The trigger selection of the advanced timer needs to select the
corresponding internal trigger signal (TIMx_SMCTRL.TSEL="ITRx"), the capture/compare preload control bit
needs to be configured to support preload (TIMx_CTRL2.CCPCTL=1) and support the rising edge of TRGI Trigger
an update (TIMx_CTRL2.CCUSEL=1).
This example is shown in the following figure.
TI2
Counter
up
TI1
down
jitter
backward
jitter
forward