Figure 114. Ch1Xor Input As Hall Sensor Interface - Holtek HT32F52342 User Manual

32-bit microcontroller with arm cortex-m0+ core
Table of Contents

Advertisement

32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F52342/HT32F52352
Using one timer as a hall sensor interface to trigger another timer with update event 2
GPTM:
Configure channel 0 to choose an input XOR function (TI0SRC = 1)
Configure channel 0 to be in the input capture mode and TRCED as capture source (CH0CCS=
0x03) and Enable channel 0 (CH0E=1)
Configure the UEVG bit as the source of MTO (MMSEL= 0x00)
Configure TI0BED to be connected to STI (TRSEL = 0x08)
Configure the counter to be in the slave restart mode (SMSEL = 0x04)
Enable GPTM (TME=1)
MCTM:
Select GPTM MTO to be the STI source of MCTM (TRSEL = 0x0A)
Enable the CHxE, CHxNE and CHxOM preload function (COMPRE = 1)
Select the rising edge on STI to generate an update event 2 (COMUS = 1)
Enable the update event 2 interrupt (UEV2IE = 1)
In the update event 2 ISR: write CHxE, CHxNE and CHxOM register for the next step
TI0XOR
CH1CCR
CH1NO
CH2NO
CH3NO

Figure 114. CH1XOR Input as Hall Sensor Interface

Rev. 1.30
GPTM
CH1
CH2
CH3
1000
CNTR
1000
1000
1000
MTO
Reset
MCTM
UEV2
CH1O
CH2O
CH3O
:Update CHxE, CHxNE, CHxOM
345 of 656
1000
1000
1000
1000
1000
September 28, 2018

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the HT32F52342 and is the answer not in the manual?

This manual is also suitable for:

Ht32f52352

Table of Contents