Features; Functional Descriptions; Counter Mode; Figure 64. Up-Counting Example - Holtek HT32F50231 User Manual

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

Advertisement

32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F50231/HT32F50241

Features

16-bit up / down auto-reload counter
16-bit programmable prescaler that allows division of the counter clock frequency by any factor
between 1 and 65536
Up to 4 independent channels for:
Compare Match Output
Generation of PWM waveform – Edge and Center-aligned Mode
Single Pulse Mode Output
Synchronization circuit to control the timer with external signals and to interconnect several
timers together
Interrupt generation with the following events:
Update event
Trigger event
Output compare match event
PWM Master / Slave mode controller

Functional Descriptions

Counter Mode

Up-Counting
In this mode the counter counts continuously from 0 to the counter reload value, which is defined
in the CRR register, in a count-up direction. Once the counter reaches the counter reload value,
the Timer Module generates an overflow event and the counter restarts to count once again from
0. This action will continue repeatedly. The counting direction bit DIR in the CNTCFR register
should be set to 0 for the up-counting mode.
When the update event is generated by setting the UEVG bit in the EVGR register to 1, the counter
value will also be initialized to 0.
CK_PSC
CNT_EN
CK_CNT
CNTR
CRR
F5
CRR Shadow
Register
PSCR
PSCR Shadow
Register
PSC_CNT
Counter Overflow
Update Event Flag
Write a new value

Figure 64. Up-counting Example

Rev. 1.00
F2
F3
F4
F5
F5
0
0
0
Update the new value
248 of 486
0
1
2
36
36
1
1
0
1
0
1
0
Software clearing
3
1
0
1
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?

This manual is also suitable for:

Ht32f50241

Table of Contents