using the ht16e07 to display time temperature and …using the ht16e07 to display time, temperature...
TRANSCRIPT
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 1 / 20 July 16, 2017
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
D/N: AN0461E
Introduction EPD (Electronic Paper Displays) are implemented using a bi-stable display technique.
The displays consist of a number of microcups or microcapsules, which are filled with
charged coloured particles. The charged particles can move in a liquid environment
under the control of an external electric field to display different colours. When the display
content is static and not changing there is zero power consumption with the display
remaining constant even when power is removed. With its high black and white color
contrast feature, it can be generally called electronic paper.
The HT16E07 is a Holtek segment type electronic paper driver IC, which contains a
120-Segment, 1-Background and 1-Common pins. The IC provides 4 COMBG pins and
can be set to either COM or BG output type according to the desired application. The
output driver voltage has three levels GND, VDL and VDH, which are provided by the
internal charge pump circuit. The 3-wire SPI interface is designed to allow the device to
communicate with a master MCU. It is suitable for use in applications such as segment
electronic shelf labels, medical displays, smart wristbands, message displays,
thermometers and hygrometers, etc. Here a demo board will be introduced which will
display time, temperature and humidity using EPD along with a master MCU which is a
HT66F0185 (28SSOP), and the driver HT16E07 IC.
Operating Principle
HT16E07 Specification Operating voltage: 2.4V~3.6V
3 driving voltage levels: GND, VDL and VDH
120-Segment, 1-Background and 1-Common
Internal Look Up Table, Charge Pump controller and Temperature sensor
3-wire SPI serial interface
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 2 / 20 July 16, 2017
HT16E07 Communication
The HT16E07 can set up functions and transmit data with the master MCU using a 3-wire
SPI interface, as shown below.
Read/Write Operation Timing Diagram
The HT16E07 can implement read/write operations. Write operation can be divided into
the Command type and the Command+Parameter type. Read operations only support
the Command+Parameter type.
Write Operation
Command Operation
When the CSB bit is enabled, the first bit of the SDA pin is “0”, and an 8-bit command will
be output. The CSB bit will be disabled when the data transmission has completed. The
specific operation is shown in the following figure.
Command Type Write Operation Timing Diagram
Command+Parameter Operation
Here a command is transmitted first. When the CSB bit is enabled, a command is
transmitted first. The first bit on the SDA pin is “0”, after which an 8-bit command will be
output. The CSB bit will be disabled when the data transmission has completed. The
parameter will be transmitted after the command has been transmitted. The CSB bit will be
enabled after a delay time, the first bit on the SDA pin is “0”, after which 8-bits of data will be
output. The CSB bit will be disabled when the data transmission has completed. According
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 3 / 20 July 16, 2017
to the corresponding command data format, the next data will be transmitted by repeating
the action of sending the parameter.
Command+Parameter Type Write Operation Timing Diagram
Read Operation
Here a command is transmitted first. When the CSB bit is enabled, a command is
transmitted first. The first bit on the SDA pin is “0”, after which an 8-bit command will be
output. The CSB bit will be disabled when the data transmission has completed. The
parameter will be sent after the command has been transmitted. The CSB bit will be
enabled after a delay time and the device will enter the read data mode. At this time, the
first bit on the SDA pin is “1”, after which 8-bits of data will be received. The CSB bit is
disabled when the data reception has completed.
Read Operation Timing Diagram
Command Introduction
Panel Setting (PSR) Command
Command R/W D/CX Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Def. Address 0 0 0 0 0 0 0 0 0 0 00h
Panel Setting (PSR) 0 1 BWR — — — VDLH
_EN DDX SHD_N
RST_N 8Fh
BWR: Black/white or red selection
0: Red. The VDH and VDL values are set by the PWR register.
1: Black/White. The VDH value is fixed at 12V. The VDL value is set by the PWR
register.
VDLH_EN: VDL/VDH voltage source selection
0: VDL/VDH voltage is sourced from the VDL/VDH pin.
1: VDL/VDH option is configured by the internal Charge Pump.
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 4 / 20 July 16, 2017
DDX: Data state selection
0: "0: White;1: Black/Red"
1: "0: Black/Red;1: White"
SHD_N: Charge Pump control
0: Off
1: On
If the SHD_N bit is cleared to zero, the Charge Pump is automatically switched off.
At this time, if the VDLH_EN bit is set high, the driver output pin will be connected
to ground.
RST_N: Reset setting
0: All registers are returned to their default values
1: Normal operation
Power Setting (PWR) Command
Command R/W D/CX Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Def. Address 0 0 0 0 0 0 0 0 0 1 01h
Power Setting (PWR)
0 1 — — VDH_LV[5:0] 1Eh 0 1 — — VDL_LV[5:0] 1Eh
VDH_LV[5:0]: The default value is 1Eh,VDH=7.0V.
VDL_LV[5:0]: The default value is 1Eh,VDH=3.5V.
Refer to the HT16E07 datasheet for more details.
Charge Pump ON (CPON) Command
Command R/W D/CX Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Def. Charge Pump ON (CPON) 0 0 0 0 0 0 0 1 0 0 04h
After the CPON command is executed, the Charge Pump will start to operate and the
BUSY_N flag will be set high.
The Charge Pump function should be enabled before users access the HT16E07.
COMBG Set (CBS) Command
Command R/W D/CX Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Def. Address 0 0 0 0 0 0 0 1 0 1 05h COMBG Set (CBS) 0 1 — — — — CBS3 CBS2 CBS1 CBS0 0Bh
CBS3: 0: COMBG3 pin is configured as a COM pin.
1: COMBG3 pin is configured as a BG pin.
CBS2: 0: COMBG2 pin is configured as a COM pin
1: COMBG2 pin is configured as a BG pin.
CBS1: 0: COMBG1 pin is configured as a COM pin
1: COMBG1 pin is configured as a BG pin.
CBS0: 0: COMBG0 pin is configured as a COM pin
1: COMBG0 pin is configured as a BG pin.
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 5 / 20 July 16, 2017
Frame Rate Control (FRC) Command Command R/W D/CX Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Def.
Address 0 0 0 0 1 1 0 0 0 0 30h Frame Rate
Control (FRC) 0 1 SF[1] SF[0] NF[1] NF[0] — P2 P1 P0 83h
SF[1:0]: On/off frequency during the Charge Pump start-up period
SF[1] SF[0] Frequency 0 0 2MHz 0 1 4 MHz 1 0 8 MHz(default) 1 1 12 MHz
NF[1:0]: On/off frequency after the Charge Pump has stabilised
NF[1] NF[0] Frequency 0 0 2MHz(default) 0 1 4 MHz 1 0 8 MHz 1 1 12 MHz
P[2:0]: Frame rate
P[2:0] Frame rate 000 10 Hz 001 20 Hz 010 40 Hz 011 50 Hz(default) 100 57 Hz 101 67 Hz 110 80 Hz 111 100 Hz
During the Charge Pump start-up period, the default on/off frequency is 8MHz. If the
operating voltage is 3V, it will take 40ms for the VDH/VDL voltage to rise to a stable value.
When the Charge Pump is stable, the on/off frequency is set to 2MHz to reduce power
consumption.
Data Start Transmission (DTM) Command
Command R/W D/CX Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Def. Address 0 0 0 0 0 1 0 0 0 0 10h
Data Start Transmission
(DTM) (17-byte
command)
0 1 S1 S2 S3 S4 S5 S6 S7 S8 00h 0 1 S9 S10 S11 S12 S13 S14 S15 S16 00h 0 1 S17 S18 S19 S20 S21 S22 S23 S24 00h 0 1 S25 S26 S27 S28 S29 S30 S31 S32 00h 0 1 S33 S34 S35 S36 S37 S38 S39 S40 00h 0 1 S41 S42 S43 S44 S45 S46 S47 S48 00h 0 1 S49 S50 S51 S52 S53 S54 S55 S56 00h 0 1 S57 S58 S59 S60 S61 S62 S63 S64 00h 0 1 S65 S66 S67 S68 S69 S70 S71 S72 00h 0 1 S73 S74 S75 S76 S77 S78 S79 S80 00h 0 1 S81 S82 S83 S84 S85 S86 S87 S88 00h 0 1 S89 S90 S91 S92 S93 S94 S95 S96 00h 0 1 S97 S98 S99 S100 S101 S102 S103 S104 00h 0 1 S105 S106 S107 S108 S109 S110 S111 S112 00h 0 1 S113 S114 S115 S116 S117 S118 S119 S120 00h 0 1 BG — — — — — — — 00h
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 6 / 20 July 16, 2017
VCOM LUT (LUTV) Command
Command R/W D/CX Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Def.
VCOM LUT (LUTV) (16-byte command,
bytes 2~4 repeated 5 times)
0 0 0 0 1 0 0 0 0 0 20h
0 1 LVL_V1[1:0] FRM_V1[5:0] 00h
0 1 LVL_V2[1:0] FRM_V2[5:0] 00h 0 1 PHS_V[7:0] 00h
LVL_V1[1:0]: (bytes 2, 5, 8, 11, 14): Voltage Level selection(1)
LVL_V2[1:0]: (bytes 3, 6, 9, 12, 15): Voltage Level selection (2)
FRM_Vx[5:0] Level(x) 00 VDL 01 VDH 10 0V 11 Floating
FRM_V1[5:0]: (bytes 2, 5, 8, 11, 14): Number of Frames (1)
FRM_V2[5:0]: (bytes 3, 6, 9, 12, 15): Number of Frames (2)
FRM_Vx[5:0] Number of Frames (x) 000000 0 000001 1 000010 2 000011 3
: : 111111 63
PHS_V[7:0]: (bytes 4, 7, 10, 13, 16): Number of Phases
PHS_V[7:0] Number of Phases 00000000 0 00000001 1 00000010 2 00000011 3
: : 11111111 255
This command is used to store five phase data for VCOM LUT. Each phase information
consists of three bytes.
BlackBlack LUT (LUT_KK) Command
Command R/W D/CX Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Def.
BlackBlack LUT (LUT_KK)
(16-byte command, bytes 2~4 repeated 5
times)
0 0 0 0 1 0 0 0 0 0 21h
0 1 LVL_KK1[1:0] FRM_KK1[5:0] 00h
0 1 LVL_KK2[1:0] FRM_KK2[5:0] 00h
0 1 PHS_KK[7:0] 00h
LVL_KK1[1:0]: (bytes 2, 5, 8, 11, 14): Voltage Level selection(1)
LVL_KK2[1:0]: (bytes 3, 6, 9, 12, 15): Voltage Level selection (2)
FRM_KKx[5:0] Level(x) 00 VDL 01 VDH 10 0V 11 Floating
FRM_KK1[5:0]: (bytes 2, 5, 8, 11, 14): Number of Frames (1)
FRM_KK2[5:0]: (bytes 3, 6, 9, 12, 15): Number of Frames (2)
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 7 / 20 July 16, 2017
FRM_KKx[5:0] Number of Frames (x) 000000 0 000001 1 000010 2 000011 3
: : 111111 63
PHS_KK[7:0]: (bytes 4, 7, 10, 13, 16): Number of Phases
PHS_KK[7:0] Number of Phases 00000000 0 00000001 1 00000010 2 00000011 3
: : 11111111 255
This command is used to store five phase data for BlackBlackLUT. Each phase
information consists of three bytes.
BlackBlack: The colour changes from black to black.
BlackWhite LUT (LUT_KW) Command
Command R/W D/CX Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Def.
BlackWhite LUT (LUT_KW) (16-byte command,
bytes 2~4 repeated 5 times)
0 0 0 0 1 0 0 0 0 0 22h 0 1 LVL_KW1[1:0] FRM_KW1[5:0] 00h
0 1 LVL_KW2[1:0] FRM_KW2[5:0] 00h
0 1 PHS_KW[7:0] 00h
LVL_KW1[1:0]: (bytes 2, 5, 8, 11, 14): Voltage Level selection(1)
LVL_KW2[1:0]: (bytes 3, 6, 9, 12, 15): Voltage Level selection (2)
FRM_KWx[5:0] Level(x) 00 VDL 01 VDH 10 0V 11 Floating
FRM_V1[5:0]: (bytes 2, 5, 8, 11, 14): Number of Frames (1)
FRM_V2[5:0]: (bytes 3, 6, 9, 12, 15): Number of Frames (2)
FRM_KWx[5:0] Number of Frames (x) 000000 0 000001 1 000010 2 000011 3
: : 111111 63
PHS_KW[7:0]: (bytes 4, 7, 10, 13, 16): Number of Phases
PHS_KW[7:0] Number of Phases 00000000 0 00000001 1 00000010 2 00000011 3
: : 11111111 255
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 8 / 20 July 16, 2017
This command is used to store five phase data for BlackWhite LUT. Each phase
information consists of three bytes.
BlackWhite: The color changes from black to white.
WhiteBlack LUT (LUT_WK) Command
Command R/W D/CX Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Def.
WhiteBlack LUT (LUT_WK)
(16-byte command, bytes 2~4 repeated 5
times)
0 0 0 0 1 0 0 0 0 0 23h 0 1 LVL_WK1[1:0] FRM_WK1[5:0] 00h
0 1 LVL_WK2[1:0] FRM_WK2[5:0] 00h
0 1 PHS_WK[7:0] 00h
LVL_WK1[1:0]: (bytes 2, 5, 8, 11, 14): Voltage Level selection(1)
LVL_WK2[1:0]: (bytes 3, 6, 9, 12, 15): Voltage Level selection (2)
FRM_WKx[5:0] Level(x) 00 VDL 01 VDH 10 0V 11 Floating
FRM_WK1[5:0]: (bytes 2, 5, 8, 11, 14): Number of Frames (1)
FRM_WK2[5:0]: (bytes 3, 6, 9, 12, 15): Number of Frames (2)
FRM_WKx[5:0] Number of Frames (x) 000000 0 000001 1 000010 2 000011 3
: : 111111 63
PHS_WK[7:0]: (bytes 4, 7, 10, 13, 16): Number of Phases
PHS_WK[7:0] Number of Phases 00000000 0 00000001 1 00000010 2 00000011 3
: : 11111111 255
The command is used to store five phase data for WhiteBlack LUT. Every phase
information consists of three bytes.
WhiteBlack: The color changes from white to black.
WhiteWhite LUT (LUT_WW) Command
Command R/W D/CX Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Def.
WhiteWhite LUT (LUT_WW) (16-byte command,
bytes 2~4 repeated 5 times)
0 0 0 0 1 0 0 0 0 0 24h
0 1 LVL_WW1[1:0] FRM_WW1[5:0] 00h
0 1 LVL_WW2[1:0] FRM_WW2[5:0] 00h
0 1 PHS_WW[7:0] 00h
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 9 / 20 July 16, 2017
LVL_WW1[1:0]: (bytes 2, 5, 8, 11, 14): Voltage Level selection(1)
LVL_WW2[1:0]: (bytes 3, 6, 9, 12, 15): Voltage Level selection (2)
FRM_WWx[5:0] Level(x) 00 VDL 01 VDH 10 0V 11 Floating
FRM_WW1[5:0]: (bytes 2, 5, 8, 11, 14): Number of Frames (1)
FRM_WW2[5:0]: (bytes 3, 6, 9, 12, 15): Number of Frames (2)
FRM_WWx[5:0] Number of Frames (x) 000000 0 000001 1 000010 2 000011 3
: : 111111 63
PHS_WW[7:0]: (bytes 4, 7, 10, 13, 16): Number of Phases
PHS_WW[7:0] Number of Phase 00000000 0 00000001 1 00000010 2 00000011 3
: : 11111111 255
The command is used to store five phase data for WhiteWhiteLUT. Every phase
information consists of three bytes.
WhiteWhite: The color changes from white to white.
HT16E07 Initialisation
The HT16E07 should be initialised before being used. Before the HT16E07 starts
operation, users should first send a CPON command to start the module and then select
options such as “Black/white or red”, “VDL/VDH selection” etc. using the PSR command.
The COMBGn pin is configured as a COM or BG output by using the CSB command. Set
the frame rate using the FRC command and set the electronic paper output waveform
rules using the commands LUTV, LUT_KK, LUT_KW, LUT_WK and LUT_WW. Refer to
the “Command Description” section for more command details. After the initialisation has
completed, the HT16E07 will operate normally.
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 10 / 20 July 16, 2017
Initialization Process
Hardware Description
System Block Diagram
The master MCU is a HT66F018 with a 28SSOP package type.
Power Circuit
USB is powered by a HT7133
Single CR2032 power supply
12-bit A/D Circuit
Battery voltage sampling
Key Circuit
Mode Selection and function setting
EPD Display Screen - HT16E07
Display information about demo board function
Clock Circuit - HT1381
Used by the demo board to display current time
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 11 / 20 July 16, 2017
Application Circuits Overall diagram
Power Circuit
The power circuit is shown in the above figure. The system is powered by an external
power supply and a battery. The external power supply will output a stable voltage of
3.3V using a HT7133 regulator for the system. LED1 is used to indicate whether an
external power supply has been connected. For the battery supply a single CR2032 3V
button cell is used. The external power supply and the battery are connected to the
system VDD pin using the schottky diodes D1 and D2.
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 12 / 20 July 16, 2017
Clock Circuit
The clock circuit is composed of an HT1381 and is shown in the above figure. The
HT1381 can implement both calendar and clock functions using hardware. A 32.768 kHz
crystal oscillator is all that is required when the HT1381 operates with other MCUs. When
using the HT1381, only write the initial date into the relevant registers, after which the
current data value can be read out from the HT1381. Resistors R17, R18 and R19 have a
value of about 100Ω and are used to attenuate any noise signals to improve the
anti-interference ability and ensure system stability.
Display Module Circuit
The master MCU communicates with the Electronic Paper driver IC, HT16E07, using a
3-Wire interface. Resistors R10, R11, R12, R13, R14, R15 and R16 have a value of
about 510Ω and are used to attenuate any noise signals to improve the anti-interference
ability and ensure system stability. Set the HT16E07 as a master device by pulling high
the MS pin level. Start the Charge Pump by pulling high the SHD_N pin level. The
HT16E07 initialisation, function setting and data updating can all be executed using the
3-wire interface.
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 13 / 20 July 16, 2017
Master Circuit
There are four keys in the demo board which are "UP", "DOWN", "SET" and "SEL" whose
functions are evident by their names. The four keys are pin-shared with I/O pins, all of
which have wake-up functions The MCU will be woken-up from the SLEEP mode when
any key is pressed.
Software Description
Main Program Flowchart and Description
main
System_State1.HT1381_Updata=1;u8_StateMode=1;
RamClean();IO_Initial();
HT16E07_Initial();HT1381_Initial();Timer_Initial();
GCC_CLRWDT();State_Manager();
HT16E07_UpData();Halt_Manager();
Main Program Flowchart
The initialisation functions such as RAM cleaning, I/O initialisation, timer setting,
HT16E07 and HT1381 initialisation are implemented using the MCU power-on program.
After the initialisation has completed , the Electronic Paper Display will display
“Temperature time display” mode. The system will enter the standby state and will wait
until the key or timer interrupt is triggered. The specific process is shown in the above
figure.
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 14 / 20 July 16, 2017
Operating Mode Switching Program Flowchart and Description State_Manager
Whether the "SET Key" is long- pressed ?
RET
Y
Exit the clock adjustment mode and
save settings
Whether it is in the clockadjustment mode?
u8_StateMode==1 ?
Enter the clock adjustment mode
u8_StateMode==2 ?
u8_StateMode==3 ?
u8_StateMode==4 ?
u8_StateMode==10 ?
Temperature and time display mode
Humidity and time display mode
Temperature and illumination display mode
Humidity and pressure display mode
Clock setting mode
N
N
Y
Y
Y
Y
Y
Y
N
N
N
N
N
System_State1.HT1381_Updata==1 ?
HT1381_Manager();ADC_Sample();
Y
N
Operating Mode Switching Program Flowchart
The first part of the program is used to detect whether the “SET” key has experienced a
long-press, which means being pressed for more than 2s. If a long-press has been
detected, enter the clock adjustment mode or exit the clock adjustment mode. Enter the
relevant operating mode according to the u8_StateMode value. If the
System_State1.HT1381_Updata is “1”, read the HT1381 current time, detect the current
battery voltage and update the display data.
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 15 / 20 July 16, 2017
Operating Voltage Collecting Subprogram Flowchart and Description
ADC_Sample
whether it isunder Voltage ?
RET
Y
Collect MCU VDD Voltage for a total Of 10 times. After the
maximum and minimum values are removed, the remaining
values will be averaged.
Compare the collected A/D value with the internal low
voltage A/D reference value, and determine whether it is
under voltage
S12=1;Light under voltage icon
S12=0; clean under voltage icon
N
Operating Voltage Collecting Flowchart
The A/D converter will sample the battery voltage value 10 times. After the maximum and
minimum values are removed, the remaining values will be averaged to get the nAdc
value. Then compare the sampled nAdc value with the internal preset M-BatV value, if
the nAdc value is equal to or greater than the M_BatV value, it means that the battery
capacity is normal and a battery under voltage icon can be output. If the nAdc value is
less than the M_BatV value, then this is considered to be under voltage and a battery
under voltage icon can be illuminated.
Key Detecting Subprogram Flowchart and Description
Key_Manager
Check whether the key state changes?
RET
Y
Whether the keys Key_Up, Key_Down, Key_Set and Key_Select have been pressed, and debounced properly
According to the change of each key state, judge that the key is "pressed" or "loosened"
According to the Key_Up and Key_Down keys pressed time, judge that the key is "short-pressed" or "long-
pressed"
According to the Key_Set key pressed time,judge whether the key is "long- pressed (greater than 2s)"
N
Key Detecting Flowchart
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 16 / 20 July 16, 2017
Determine the "SET", "SEL", "UP" and "DOWN" keys level status to see if any of these
keys have been pressed and to obtain the revelant key value. After an appropriate
debounce, get the current "SET", "SEL", "UP" and "DOWN" key values and determine
whether the key has experienced a long-press or a short- press by using the change of
key state.
HT1381 Application Subprogram and Flowchart
HT1381_SetTime
RET
HT1381_Tx(0b10001110);HT1381_Tx(0b00000000);
HT1381_Tx(BurstMode_W);
Write seconds, minutes, hours, days, weeks, months and years in order
HT1381_Tx(0b10001110);HT1381_Tx(0b00000000);
HT1381_Tx(BurstMode_W);
Read seconds, minutes, hours, days, weeks, months and years in order
HT1381_GetTime
RET
HT138 Application Flowchart
As shown, when setting the time, send the command to set the HT1381 to be in a
writeable status, then set to the multibyte readable and writeable mode, the default time
values such as seconds, minutes, hours, days, weeks, months and years can then be
written to the HT1381 in turn. After finishing writing, send a command to set the HT1381
to be in a write protection status. When reading the time, send a command to set the
HT1381 to be in a writable status, then set to the multibyte readable and writeable mode
and then read the time values such as seconds, minutes, days, weeks, months, and
years from the HT1381 in turn.
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 17 / 20 July 16, 2017
HT16E07 Display Subprogram Flowchart and Description
HT16E07_UpData
System_State2.HT16E07_Updata==1?
RET
Y
HT16E07_3Wire_Tx(0,FLG_GetStatus_CMD);nRead=HT16E07_3Wire_Rx();
IO_BUSY_N!=0?
(nRead&0x01)!=0?
Update the HT16E07 display data
HT16E07_3Wire_Tx(0,FLG_GetStatus_CMD);nRead=HT16E07_3Wire_Rx();
(nRead&0x01)!=0?
HT16E07_3Wire_Tx(0,CPOF_ChargePumpOFF_CMD);HT16E07_3Wire_Tx(1,0x00);
IO_CSB=1;IO_MS=1;IO_SCL=1;IO_SDA=1; Enter the SLEEP mode
System_State2.HT16E07_Busy!=0?
Y
Y
Y
Y
N
N
N
N
N
HT16E07 Display Flowchart
When the System_State2.HT16E07_Updata is "1", send a command to enable the
Charge Pump to determine whether the IO_BUSY_N state is idle before updating. Read
the FLG_GetStatus value before updating to determine whether the HT16E07 can
update the FLG_GetStatus value according to the data format in the IDLE Mode. After
the data transmission has completed, read the FLG_GetStatus value to determine
whether the data updating has completed. If it has completed then send a command to
disable the Charge Pump.
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 18 / 20 July 16, 2017
Application Examples
Source Code File
HT16E07_HT66F0185-DB-20170602-AN.z
SCH & PCB Drawing Files
sch&pcb.zip
Operating Description
Demo Board Functional Description The Demo Board can be powered by external an USB interface and battery. When the
key “SW” is set to the "ON" position the system will be powered on. The default time, the
current temperature and weather conditions will be displayed on the screen. Users can
switch the current display screen by pressing the "SEL" key. A long-press of the "SET"
key will allow the time to be entered in the time setting mode. In this mode, switch to
"hour" and "minute" by pressing the "SEL" key. Increase or decrease the "hour" and
"minute" values by pressing the "UP" and "DOWN" keys. Finish the time setting with a
long-press of the "SET" key after completing the above settings.
The Whole Figure SET SEL DOWN UP
SW
USB Interface
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 19 / 20 July 16, 2017
Conclusion Based on the features of the HT16E07, this application note has introduced how to use
the HT16E07 driver for electronic paper applications. Combined with the Demo Board
program examples, it should prove helpful for users to quickly learn how use the
HT16E07 device features and functions.
Version and Modification Information Date Author Issue
2017.06.02 郑金显 First Version
Reference Files Reference file: HT16E07 Datasheet。
For more information, refer to the Holtek official website http://www.holtek.com/en.
Disclaimer
Disclaimer All information, trademarks, logos, graphics, videos, audio clips, links and other items
appearing on this website ('Information') are for reference only and is subject to change at
any time without prior notice and at the discretion of Holtek Semiconductor Inc. (herein
after 'Holtek', 'the company', 'us', 'we' or 'our'). Whilst Holtek endeavors to ensure the
accuracy of the Information on this website, no express or implied warranty is given by
Holtek to the accuracy of the Information. Holtek shall bear no responsibility for any
incorrectness or leakage.
Holtek shall not be liable for any damages (including but not limited to computer virus,
system problems or data loss) whatsoever arising in using or in connection with the use of
this website by any party. There may be links in this area, which allow you to visit the
websites of other companies. These websites are not controlled by Holtek. Holtek will
bear no responsibility and no guarantee to whatsoever Information displayed at such sites.
Hyperlinks to other websites are at your own risk.
Limitation of Liability In no event shall Holtek Limited be liable to any other party for any loss or damage
whatsoever or howsoever caused directly or indirectly in connection with your access to
or use of this website, the content thereon or any goods, materials or services.
Using the HT16E07 to Display Time, Temperature and Humidity in Electronic Paper Displays Application
AN0461E V1.00 20 / 20 July 16, 2017
Governing Law The Disclaimer contained in the website shall be governed by and interpreted in
accordance with the laws of the Republic of China. Users will submit to the non-exclusive
jurisdiction of the Republic of China courts.
Update of Disclaimer Holtek reserves the right to update the Disclaimer at any time with or without prior notice,
all changes are effective immediately upon posting to the website.