
Rev. 1.00
541 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
27 LED Controller (LEDC)
27 LED Controller (LEDC)
Bits
Field
Descriptions
[0]
LEDEN
LEDC Enable Bit
0: Disable
1: Enable
The LEDC state machine will be enabled when this bit is set to 1. If this bit is set
to 0, the state machine will continue to output until the current frame operation is
completed, then the state of the state machine will be cleared and finally the LEDEN
bit will be cleared to zero by the hardware.
Therefore, the LEDEN bit must be polled continuously after clearing the LEDEN bit
has been executed, the LED controller will not actually cease operation until the
LEDEN becomes 0.
When the LEDEN bit is set high, the LEDSRC, LEDPS and DTYNUM bit field
contents should remain unchanged. Even if new data is written into these bit fields,
they are invalid, however the LEDDR and DEADNUM bit fields can be modified. It is
recommended to update in the frame interrupt subroutine.
LED COM Enable Register – LEDCER
This register is used to control the COMy enable, (y = 0 ~ 11).
Offset:
0x004
Reset value: 0x0000_0000
31
30
29
28
27
26
25
24
Reserved
Type/Reset
23
22
21
20
19
18
17
16
Reserved
Type/Reset
15
14
13
12
11
10
9
8
Reserved
COM11EN COM10EN COM9EN COM8EN
Type/Reset
RW 0 RW 0 RW 0 RW 0
7
6
5
4
3
2
1
0
COM7EN COM6EN COM5EN COM4EN COM3EN COM2EN COM1EN COM0EN
Type/Reset RW 0 RW 0 RW 0 RW 0 RW 0 RW 0 RW 0 RW 0
Bits
Field
Descriptions
[11:0]
COMyEN
COMy Enable Bit (y = 0 ~ 11)
0: COMy disable
1: COMy enable
In a complete frame period, tframe, the enabled COMs will be scanned from low
number to high number.
Assuming that four 8-segment LEDs are used, the COM7EN, COM6EN, COM5EN
and COM0EN bits are set to 1 and the remaining bits are set to zero. Here COM0,
COM5, COM6 and COM7 will be scanned successively within a complete frame
period. The scanning time of for each COM port is equal to 1/4 t
frame
, which is
subdivided into dead time duty and COM duty. Users can adjust the dead time duty
to change the LED brightness.
Therefore, a complete frame scans COM0 → COM5 → COM6 → COM7 in sequence.
If no COMyEN bit is set, the LEDC will not operate after LEDEN is enabled.