
Rev. 1.00
538 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
27 LED Controller (LEDC)
LEDC
D
ata Update Method
After the LEDC function is enabled, if the displayed characters need to be updated, it is
recommended to use a frame interrupt to update the pixel data. Using this method will more
effectively maintain the display integrity of each frame. The corresponding relationship between
the LED pixel data and (SEGx, COMy) is shown in the table below. The LED pixel data writing
method is the same as that of the LEDC data register.
Table 67. LED Pixel Data and (SEGx, COMy) Relationship
LEDDRn SEG7
SEG6
SEG5
SEG4
SEG3
SEG2
SEG1
SEG0
COMy
CnS7
CnS6
CnS5
CnS4
CnS3
CnS2
CnS1
CnS0
Note:
SEGx corresponds to the CnSx bit in the LEDDRn register and COMy corresponds to the
LEDDRn register. The CnSx value represents the pixel data of the 8-segment digital display.
Frame Rate Calculation
The calculation formula of the frame rate frequency is as follows:
f
frame
= f
CK_LED
/ [(Duty clocks)
×
N]
Where N is the number of COMs selected. For the HT32F54231/HT32F54241, the maximum
value of N is 8. For the HT32F54243/HT32F54253, the maximum value of N is 12. The duty clock
number can be configured as 8, 16, 32 or 64 by the DTYNUM[1:0] bit field in the LEDDTCR
register. The f
CK_LED
is calculated by the following formula. The f
clock source
can be selected to be
sourced from LSI, LSE or PCLK.
f
CK_LED
= f
clock source
/ [LEDPS + 1]
Examples
(1) If the CK_LED clock source f
clock source
is 32.768 kHz, DTYNUM[1:0] = b11, LEDPS[11:0] =
0x000 and 8 COMs are enabled, then the frame rate can be calculated as follows.
Frame rate = 32768 Hz / (64
×
8) = 64 Hz
If the operating frequency needs to be greater than 120Hz, this can be implemented by setting
the DTYNUM[1:0] bits to b10. The frame rate can be calculated as follows.
Frame rate = 32768 Hz / (32
×
8) = 128 Hz
(2) If the CK_LED clock source f
clock source
is 60 MHz, DTYNUM[1:0] = b11, LEDPS[11:0] = 0x7FF
and 8 COMs are enabled, then the frame rate can be calculated as follows.
Frame rate = [60 MHz / (2047 + 1)] / (64
×
8) = 60 Hz
If the operating frequency needs to be greater than 120 Hz, this can be implemented by setting
LEDPS[11:0] to 0x3FF
.
The frame rate can be calculated as follows.
Frame rate = [60 MHz / (1023 + 1)] / (64
×
8) = 120 Hz
If the operating frequency needs to be greater than 120 Hz, this can also be implemented by
setting the DTYNUM[1:0] bits to b10. The frame rate can be calculated as follows.
Frame rate = [60 MHz / (2047 + 1)] / (32
×
8) = 120 Hz