16 SEVEN-SEGMENT LED CONTROLLER (LEDC)
16-4
Seiko Epson Corporation
S1C17M12/M13 TECHNICAL MANUAL
(Rev. 1.2)
6. Set the following bits when using the interrupt:
- Write 1 to the LEDCINTF.CM0LTIF bit.
(Clear interrupt flag)
- Set the LEDCINTE.CM0LTIE bit to 1.
(Enable LEDC interrupt)
16.4.2 Display On/Off
The seven-segment LED display state is controlled using the LEDCCTL.DSPON bit. The display is turned on by
writing 1 to the LEDCCTL.DSPON bit and is turned off by writing 0. When the display is resumed by writing 1 to
the LEDCCTL.DSPON bit after it is turned off, the COM0 always starts lighting first. When setting the LEDCCTL.
MODEN bit to 0 with the display turned off, wait at least twice as long as the COM lighting period (LP) before
writing 0 to the LEDCCTL.MODEN bit after 0 is written to the LEDCCTL.DSPON bit.
16.4.3 Common Mode
The LEDCCTL.COMMOD bit is provided to select a common mode (anode common or cathode common) accord-
ing to the seven-segment LED module to be used. The driver states at the COM signal and SEG signal off times
can also be set using the LEDCCTL.CMOFFMOD bit and the LEDCCTL.SGOFFMOD bit, respectively.
Table 16.4.3.1 Settings of Common Mode and Driver State at COM/SEG Off Time
LEDCCTL.
COMMOD bit
LEDCCTL.
CMOFFMOD bit
LEDCCTL.
SGOFFMOD bit
Common mode
Driver state
at COM off time
Driver state
at SEG off time
1
1
1
Cathode common
COM = Hi-Z
SEG = Hi-Z
0
SEG = L
0
1
COM = H
SEG = Hi-Z
0
SEG = L
0
1
1
Anode common
COM = Hi-Z
SEG = Hi-Z
0
SEG = H
0
1
COM = L
SEG = Hi-Z
0
SEG = H
16.4.4 Number of Display Digits
The number of display digits (number of COMs used) should be set using the LEDCCTL.NDIGITS[2:0] bits.
Table 16.4.4.1 Number of Display Digits
LEDCCTL.
NDIGITS[2:0] bits
Number of display digits
Valid COM pins
0x7
8
COM0–7
0x6
7
COM0–6
0x5
6
COM0–5
0x4
5
COM0–4
0x3
4
COM0–3
0x2
3
COM0–2
0x1
2
COM0–1
0x0
1
COM0
*
The number of COM pins that can be used depends on the model.
16.4.5 Brightness Adjustment
The brightness can be adjusted in four steps by setting the LEDCCTL.BRITCNT[1:0] bits.
The brightness adjustment is archived by controlling the COM lighting period. This control does not affect the
COM lighting cycle.
Table 16.4.5.1 Brightness Adjustment
LEDCCTL.
BRITCNT[1:0] bits
COM lighting period
(when setting to 0x0 is assumed as 1) Brightness
0x3
1/4
Dark
0x2
1/2
↑
0x1
3/4
↓
0x0
1
Bright