
Rev. 1.00
532 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
27 LED Controller (LEDC)
Features
▆
Supports 8-segment digital displays up to a maximum of N
●
For the HT32F54231/HT32F54241, N = 8
●
For the HT32F54243/HT32F54253, N = 12
▆
Supports 8-segment digital displays with common anode or common cathode
▆
Supports frame interrupt
▆
Three frequency sources: LSI, LSE and PCLK
▆
The LED light on/off times can be controlled using the dead time setting
Functional Description
The position of each pixel point is represented by SEGx and COMy. The HT32F54231/HT32F54241
devices can drive up to eight 8-segment digital displays, x = 0 ~ 7, y = 0 ~ 7. The HT32F54243/
HT32F54253 devices can drive up to twelve 8-segment digital displays,
x = 0 ~ 7, y = 0 ~ 11. The
number of COMs to be enabled is N. The following will take N = 4, here COM0, COM5, COM6
and COM7 are enabled as an example to introduce the LEDC functions.
LEDC Basic Setting
The following show the steps to configure the LEDC drive module.
▆
Set the LEDSRC, LEDPS and DTYNUM bit fields in the LEDCR register.
▆
The required COMy can be enabled through the COMyEN bit in the LEDCER register.
▆
Configure the required COMy and SEGx pins for the LEDC
functions using the AFIO function.
▆
Set the current drive capability of the COMy and SEGx.
▆
Select the COMy and SEGx output polarity by configuring the LEDPCR register.
▆
Select the dead time clock number by the DEADNUM bit field in the LEDDTCR register.
▆
Initialise the LEDDR register.
▆
The LEDEN bit in the LEDCR is set high to enable the LED driver module.
Except for the LEDEN bit which needs to be enabled during the last step, there is no sequence
requirement for the setup steps provided above. When the LEDEN bit is set high, the LEDSRC,
LEDPS and DTYNUM bit field contents should remain unchanged. However, the LEDDR and
DEADNUM bit fields can be modified.
LEDC Clock Source Selection
The LEDC clock can be sourced from LSI, LSE or PCLK, which is selected by the LEDPS[7:0] bit
field in the LEDCR register. The LED clock, CK_LED, is determined by the following equation:
f
CK_LED
= (LSI, LSE or PCLK) / (LEDPS[11:0] + 1)
LEDC Operational Description
Assuming that N digital displays are used, then each digital display has an operating time of 1/N
frame time. The required CK_LED clock number for each digital display scan can be configured as
8, 16, 32 or 64 by the DTYNUM[1:0] bit field in the LEDDTCR register.
1/N frame = (8, 16, 32 or 64)
×
CK_LED clock