Figure 134. Ch1Xor Input As Hall Sensor Interface - Holtek HT32F50231 User Manual

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

Advertisement

32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F50231/HT32F50241
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 =
0x3) and Enable channel 0 (CH0E = 1)
Configure the UEVG bit as the source of MTO (MMSEL = 0x0)
Configure TI0BED to be connected to STI (TRSEL = 0x8)
Configure the counter to be in the slave restart mode (SMSEL = 0x4)
Enable GPTM (TME = 1)
MCTM:
Select GPTM MTO to be the STI source of MCTM (TRSEL = 0xA)
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

Figure 134. CH1XOR Input as Hall Sensor Interface

Rev. 1.00
GPTM
CH1
CH2
CH3
TI0XOR
1000
CNTR
CH1CCR
1000
1000
1000
MTO
Reset
MCTM
UEV2
CH1O
CH1NO
CH2O
CH2NO
CH3O
CH3NO
: Update CHxE, CHxNE, CHxOM
330 of 486
1000
1000
1000
1000
1000
July 31, 2018

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Ht32f50241

Table of Contents