0% found this document useful (0 votes)
13 views28 pages

HT68FV022/024 Voice MCU Overview

The HT68FV022/024 are voice peripheral MCUs designed for various applications, featuring internal Voice Flash Memory for voice updates and PWM outputs for driving speakers. They support two development modes: peripheral mode for simplified control and professional mode for custom programming, both of which are facilitated by Holtek's Voice MCU Workshop software. This document provides detailed instructions on hardware setup, development board operation, and software usage for effective implementation of these voice ICs.

Uploaded by

Moon Nguyen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views28 pages

HT68FV022/024 Voice MCU Overview

The HT68FV022/024 are voice peripheral MCUs designed for various applications, featuring internal Voice Flash Memory for voice updates and PWM outputs for driving speakers. They support two development modes: peripheral mode for simplified control and professional mode for custom programming, both of which are facilitated by Holtek's Voice MCU Workshop software. This document provides detailed instructions on hardware setup, development board operation, and software usage for effective implementation of these voice ICs.

Uploaded by

Moon Nguyen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HT68FV022/024 Voice Application and Library Description

HT68FV022/024 Voice Application and


Library Description

D/N: AN0595EN

Introduction
Voice ICs are used in a wide range of various products such as alarm equipment, medical devices,
home appliances, toys etc.

The HT68FV022/024 are voice peripheral MCUs developed by Holtek for voice applications. One
special feature of these devices is its internal 16-M/32-Mbit Voice Flash Memory which support
repeated voice updates with up to 400/800 seconds of voice capacity, providing an easier way for
products to update their voice content.

The HT68FV022/024 also provide a pair of 9 to12-bit PWM outputs with high current capabilities
which can directly drive an 8Ω/0.5W speaker generating a loud clear sound. They are fully
supported by Holtek’s Voice MCU Workshop which can offer voice editing as well as providing a
professional mode which has ADPCM, uLaw and PCM voice compression/decompression
functions and multiple control interface libraries, all of which combine to assist with a more rapid
development process. In addition, a peripheral mode is available, removing the need for users to
write code, but to just connect to a master MCU for product development.

This application note will explain how to use the HT68FV022/024 and provide instructions for the
Firmware Library.

Functional Description
The HT68FV022/024 are specially designed for voice product developments and fully supported
by the Voice MCU Workshop for loading voice files, selecting voice compression modes, editing
sentences and control mode selection. The HT68FV022/024 support two development modes, the
peripheral mode and professional mode.

In the peripheral mode, Holtek provides users with a preset control interface and a voice
compression mode. In the Professional mode relevant firmware libraries are available, allowing
users to design their own program code.

This application note will introduce the basic hardware circuits, the Voice MCU Workshop, the
firmware libraries for the professional mode as well as the peripheral mode.

AN0595EN V1.20 1 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Hardware Description
The HT68FV022/024 use PWM outputs to drive a speaker directly and provides three I/O pins
which in the professional mode can be arranged in a flexible way by users while in the peripheral
mode they will be setup in a Holtek-specified control mode. The following will introduce the
hardware circuits in the professional mode and peripheral mode.

Professional Mode Circuit


The HT68FV022/024 application circuit diagram for the professional mode is shown in Figure 1.
PWM1 and PWM2 are used to drive the speaker directly, while the BIAS pin which is an internal
voltage, should be connected to a 0.1µF capacitor. A 10µF and a 0.1µF capacitor must be connected
between the VDD and VSS pins. The PA0~PA2 pins are free for use by users.

Figure 1. Professional Mode Circuit

Peripheral Mode Circuit


In the peripheral mode, the overall circuit for the PWM1, PWM2, VDD and BIAS pins are the same
as that of the professional mode. The control mode supports One-wire, Two-wire and Direct mode
(Key control mode). Figures 2~4 show the corresponding application circuits, where the LED will
be on when a voice is playing.

The control mode is selected in the Voice MCU Workshop.

It is also possible to switch between the One-wire and Two-wire modes using an external resistor,
here a 4.7kΩ resistor should be connected between the CLK/SEL/KEY1 pin and ground. Note that
after changing the mode either from the One-wire to the Two-wire mode or from the Two-wire to
the One-wire mode, the system needs to be powered on again, only after this is done will the new
mode be activated.

Figure 2. Peripheral Mode Circuit - One-wire Control

AN0595EN V1.20 2 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Figure 3. Peripheral Mode Circuit - Two-wire Control

Figure 4. Peripheral Mode Circuit - Direct Mode

Figure 5. Peripheral Mode One-wire / Two-wire Selection Circuit

Peripheral Mode Control


In the peripheral mode, the HT68FV022/024 can function in the One-wire mode, Two-wire mode
1 or Two-wire mode 2 to receive external MCU control commands. It can also function in the Direct
mode, where it will be controlled by external keys. The communication timing requirements and
the key function definition of the Direct mode are detailed in the HT68FV022/024 datasheet. The
control mode can be selected in the Voice MCU Workshop according to user’s application
requirements.

AN0595EN V1.20 3 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Development Environment Description

Overall Environment

Development Board Connected to the Computer via e-Link

Software
Includes Voice MCU workshop and HT-IDE3000.

 Voice MCU workshop

 Load and program the voice WAV files and configure the sentence arrangement.

 Programmed files generate and programming function.

 Generate user development projects in the Professional Mode.

 HT-IDE3000

 Edit user development projects in the Professional Mode.

AN0595EN V1.20 4 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Development Board Introduction


The development board is demonstrated using the HT68VV022/024 (HT68FV022/024 EV) together
with the HT66F018.

1. Power indicator.

2. Micro USB: USB power supply interface.

3. VDD&GND pin header interface.

4. Master MCU HT66F018.

5. Switch between 1Wire / 2Wire Mode1 / 2Wire Mode2.

6. Function key × 6.

7. Voice Peripheral MCU EV HT68VV02x.

8. Speaker interface.

9. Switch between 1Wire and 2Wire Mode1

10. HT68VV02x e-Link interface.

11. Switch between Direct Mode and 1Wire / 2Wire Mode.

12. Play BUSY indicator.

13. Master HT66F018 ICP interface.

AN0595EN V1.20 5 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Development Board Operation Description

Operating Mode Selection

After completing the programming, the operating mode should be selected on the development board
according to the Workshop settings, including Direct Mode, 1 Wire Mode, 2 Wire Mode 1 and 2 Wire
Mode 2. The mode selection method and development board operation are shown in the following
table:
Operating
Selection Method Real Product
Mode

① Select the Direct Mode in the Voice


MCU Workshop
Direct Mode
② Short-circuit the pin headers in columns
2 and 3 with jumpers

① Select 1 Wire mode in the Voice MCU


Workshop
② Short-circuit the pin headers in columns
1 and 2 with jumpers
③ Switch the DIP switch in the first row to
1WIRE

1 Wire Mode

When in the 2 Wire Mode, short-circuit the


two pin headers in the MODE with jumpers

① Select the 2 Wire Mode 1 in the Voice


MCU Workshop
② Short-circuit the pin headers in columns
1 and 2 with jumpers
③ Switch the DIP switch in the first row to
2 WIRE
④ Switch the DIP switch in the second row
to 2WIRE MODE1

2 Wire Mode 1

When in the1 Wire Mode, short-circuit the


two pin headers in the MODE with jumpers

AN0595EN V1.20 6 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Operating
Selection Method Real Product
Mode

① Select the 2 Wire Mode 2 in the Voice


MCU Workshop
② Short-circuit the pin headers in columns
1 and 2 with jumpers
2 Wire Mode 2
③ Switch the DIP switch in the first row to
2 WIRE
④ Switch the DIP switch in the second row
to 2WIRE MODE2

Function Key Description

If the operating mode selected by the development board is different, then the corresponding key
function will be different. The specific functions are described in the following table:
1Wire / 2Wire Mode Direct Mode

Short press: play the next voice Short press: play the next voice
Long press(3s): play the next sentence

Short press: play the next sentence None

play/stop(short press): play/stop


current voice/sentence Stop(short press): stop playing the
reset(long press for 3s): reset to play current voice
the first voice reset(long press for 3s): reset to play the
first voice
Cycle(short press): cycling play the
current voice/sentence
None
wake/sleep(long press for 3s): wake-
up/enter sleep

Short press: volume down None

Short press: volume up Short press: volume up


Long press(3s): volume down

e-Link Connection

The HT-IDE3000 and Voice MCU Workshop can program and edit an IC using the e-Link. The
e-Link can be directly inserted into the HT68VV022/024 e-Link interface as shown, which is
convenient for development.

When programming the HT68VV022/024, remove the jumper selected in the MODE position to
avoid affecting the programming.

AN0595EN V1.20 7 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Programming and e-Link Connection Description

 Use Voice MCU Workshop for programming

VDD
1 2 PA1/TC
3 4 PA2/ICPDA
5 6 PA0/INT/ICPDA
7 8 PB1/PWM2
9 10
11 12

GND

 Use HT-IDE3000 and HT68VV022/024 for emulation

 Use the e-Socket32 on the e-Writer32 for programming by connecting ICP

AN0595EN V1.20 8 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Development Board Schematic Diagram

Other Information
 Do not modify the internal program of the master MCU HT66F018 in the development board
as it has been setup for the HT68FV022/024 supported control interface.

 If the 1WIRE/2WIRE jumpers and DIP switches change and then it is powered on again, the
master MCU HT66F018 can be controlled in the selected mode.

Voice MCU Workshop Description


Download the latest Voice MCU Workshop from Holtek website and then execute the “Voice
[Link]”.

AN0595EN V1.20 9 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Create a new project, select the project mode to be “Peripheral IC mode” and then select whether
to use the peripheral mode or the professional mode and select the IC of HT68FV022 or
HT68FV024.

Peripheral Mode
Taking the HT68FV022 as an example, in the Basic Setting page, select the control mode, PWM
voice mode and MCU frequency in the Communication Interface and Speaker Driven sections.

There are two voice modes, the Green Mode and Normal Mode, which have different PWM output
types. For more details about this, refer to the MCU datasheet.

The frequency selection will have an influence on MCU selection, operating voltage and voice
coding compression modes, which will then affect the voice length. For example, if the MCU
frequency is 12MHz, the allowable minimal operating voltage is 2.3V but which will be 3.0V if the
frequency is 16MHz. The following table lists the supported data coding compression modes for
the MCU operating frequency.

AN0595EN V1.20 10 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Voice Quality
MCU Operating Voice Coding
High Quality - Low Normal Quality– Mid High Compression – High
Frequency Mode
Compression Ratio Compression Ratio Compression Ratio
PCM   
16MHZ uLaw   
ADPCM   
PCM   
12MHZ uLaw   
ADPCM   

In the Voice Source Setting section, users can select a voice source file and then select the coding
mode and voice quality in the Mode list and sequence the voice files, as shown below.

If an existing project, which was generated with an older version of the Voice MCU Workshop, is
opened by clicking the “Load Project” button to load, press the “Renew” button in the Voice Source
Setting section to update the voice coding data.

AN0595EN V1.20 11 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

The HT68FV022/024 support the voice program setting which allows multiple voices to be
combined into a single sentence, here a mute time can also be added, as shown below.

Select “Mute” in the Action list and type the mute time in the Action Parameter field.

After finishing the voice editing in the Voice MCU Workshop, a *.PND programming file can be
generated. In the Finish page, users can select the Programming function, as shown below, to
program the current project directly, load an already generated programming file or to only generate
the PNG file without programming being executed. The programming voltage should be chosen to
match the system voltage. The IC can be programmed using the Voice MCU Workshop via an e-
Link. Please refer to the related user’s guide document for details of the e-Link connections.

AN0595EN V1.20 12 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Professional Mode
The HT68FV022/024 support PCM, uLaw or ADPCM voice compression and decompression and
are provided with One-wire, Two-wire and Direct control interface libraries. In the professional
mode users are permitted to write firmware according to their application requirements. The
following will describe how to use this mode.

Open the Voice MCU Workshop to create a new project and click Professional Mode shown in the
red rectangle below.

Taking the HT68FV022 as an example, in the Basic Setting page, select the desired voice
compression and control interface library. The selected library will affect the remaining available
memory space, which should be taken into account when making this selection. The communication
interface control mode selection, just as in the peripheral mode, allows only one to be checked.
Selecting the “none” option means that the control interface library is not used. With regard to the
coding mode selection, PCM is required while ADPCM and uLaw are optional, both or neither can
be selected. The operation methods for the Voice Source Setting and Voice Program are the same
as that of the Peripheral mode.

In the Finish page, when the Programming function is selected to “Only generate files (PND)” as
shown below, pressing the “execute” button will only generate the project files with no programming
operation performed. Click the “Open current project” to open the current project folder.

AN0595EN V1.20 13 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Users can click the .pjtx file to open the HT-IDE3000 to edit the program. A detailed description
of the MCU functions is provided in the datasheet. How to use the library is introduced in the later
Software Description section. After compilation, a .PND file will be generated as shown below.
Use the Voice MCU Workshop to load this file and program it into the IC.

Software Description

MCU Operating Environment


Oscillator - HIRC VDD Low Voltage Reset Watchdog Timer
16MHz 5V 2.55V 1s
12MHz 5V 2.10V 1s
8MHz 5V 2.10V 1s

Software Usage Description


This Firmware only provides the basic settings and applications for the HT68FV022/024 Voice
Library Controller. The following shows the memory conditions when different combinations of
the PCM, uLaw and ADPCM voice compression methods are used. In order to meet user
requirements for the voice quality and memory capacity, six libraries for three interface modes with
different command/control methods are provided. The interface modes include Direct key mode,
Interface mode and Custom mode, where the key mode and interface mode allow users to add extra

AN0595EN V1.20 14 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

commands or customise commands/control using the project files generated by the Voice MCU
Workshop. After the selected library is used, the remaining RAM (64×8) and ROM (1K×14) space
is listed in the following table, which can be used by users to write their own code.
Operating Mode Memory PCM PCM+uLaw PCM+ADPCM PCM+uLaw+ADPCM
ROM 427 323 247 143
Interface Mode
RAM 25 25 20 20
Interface Mode with ROM 424 320 244 140
extra commands RAM 25 25 20 20
Interface Mode ROM 416 312 236 132
with custom
RAM 25 25 20 20
commands
ROM 443 339 263 159
Direct key Mode
RAM 24 24 19 19
Direct key Mode with ROM 369 265 189 85
custom control RAM 14 14 9 9
ROM 606 502 426 322
Custom Mode
RAM 36 36 31 31

Note: “Interface Mode with extra commands” refers to, in addition to the command functions
already defined in the Interface, the remaining commands which are opened for users to
define their own functions.

Function File Description


Taking the HT68FV022 as an example, by using the Voice MCU Workshop professional mode, the
voice file data processed with PCM, uLaw and ADPCM compression as well as the One-wire, Two-
wire and Direct control interfaces will all be programmed into the HT68FV022. A project folder
will also be generated and users can develop their code in the Customer file.

File Description:

 HT68FV02x_PRJ_Voice_Library_Test.asm
Main program operated according to the selected control interface

 HT68FV02x_PRJ_Def.asm
Definition of voice compression related variables

 HT68FV02x_PRJ_Customer.asm
User code area – when custom functions are used

 HT68FV02x_PRJ_Body.inc
Definition of registers and variables

 HT68FV02x_PRJ_Voice_library_Extern.inc
Declaration of subroutines and variables

 HT68FV02x_PRJ_Voice.hed
Counting function with timer interrupt

 HT68FV02x_PRJ_Voiceworkshop.hed
Operating mode definition

AN0595EN V1.20 15 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

These files are generated in the professional mode using the Voice MCU Workshop.

Figure 6. HT68FV022 File Overview Diagram

Software Main Flow Description

START

Clear RAM &


System Initia lization

Ena ble PWM Func tion

No Yes
A valid
A signal to dec ode ?
command ?

Yes No

Execute com mand


oper ation

Yes
Voice playing ?

No

Disable PWM &


Enter suspend mode

No Yes
A signal to dec ode ?

Figure 7. Interface Mode Software Main Flowchart

1. System Initialization:

Set the HT68FV022 communication interface to SPI.


Read the Flash information and set the MCU parameters.
Set the PWM function, LDO and Watchdog Timer.

AN0595EN V1.20 16 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

2. Main Loop:

(1) Enable the PWM function.


(2) Detect if there is a signal and decode it.
→ No, go to (5).
(3) Check if it is a valid command.
→ No, go to (5).
(4) Execute the command operation.
(5) Check if there is a voice playing.
→ Yes, return to (2).
(6) Disable the PWM function and enter the suspend mode.
(7) Check if there is a wake-up signal.
→ Yes, return to (1).
→ No, continue in the suspend mode.

START

Clear RAM &


System Initia lization

Ena ble PWM Func tion

Yes A valid standard Yes A signal to


command ? decode ?

No No

Execute com mand Yes Other


oper ation command ?

No
Yes
Voice playing ?

No

Disable PWM &


Enter suspend mode

No Yes
A signal to dec ode ?

Figure 8. Interface Mode with Extra Commands Software Flowchart

1. System initialisation:

Set the HT68FV022 communication interface to SPI.


Read the Flash information and set the MCU parameters.
Set the PWM function, LDO and Watchdog Timer.

AN0595EN V1.20 17 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

2. Main Loop:

(1) Enable the PWM function.


(2) Check if there is a signal and decode it.
→ No, go to (6).
(3) Check if the signal is a valid standard command.
→ Yes, go to (5).
(4) Execute the check_has_othercmd subroutine in the Customer file to check if it belongs to
other commands.
→ No, go to (6).
(5) Execute the command operation.
(6) Check if there is a voice playing.
→ Yes, return to (2).
(7) Disable the PWM function and enter the suspend mode.
(8) Check if there is a wake-up signal.
→ Yes, return to (1).
→ No, continue in the suspend mode.

START

Clear RAM &


System Initia lization

Ena ble PWM Func tion

Yes
No
A custom command ? A signal to dec ode ?

Yes No

Execute com mand


oper ation

Yes
Voice playing ?

No

Disable PWM &


Enter suspend mode

No Yes
A signal to dec ode ?

Figure 9. Interface Mode with Custom Commands Software Flowchart

1. System initialisation:

Set the HT68FV022 communication interface to SPI.


Read the Flash information and set the MCU parameters.
Set the PWM function, LDO and Watchdog Timer.

AN0595EN V1.20 18 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

2. Main Loop:

(1) Enable the PWM function.


(2) Check if there is a signal and decode it.
→ No, go to (5).
(3) Execute the customer_voice_code subroutine in the Customer file to check if the signal is a
custom command.
→ No, go to (5).
(4) Execute the command operation.
(5) Check if there is a voice playing.
→ Yes, return to (2).
(6) Disable the PWM function and enter the suspend mode.
(7) Check if there is a wake-up signal.
→ Yes, return to (1).
→ No, continue in the suspend mode.

START

Clear RAM &


System Initia lization

Ena ble PWM Func tion

Play the first voice or Yes Yes


Trigger Tim e
sentence or dec rease > 3s ? Button is triggered ?
volume
No No

Stop voic e or
Play voice or
incr ease volum e

Yes
Voice playing ?

No

Button No
is rese t ?

Yes

Disable PWM &


Enter suspend mode

No Button Yes
is triggere d ?

Figure 10. Direct Key Mode Software Flowchart

1. System Initialisation:

Set the HT68FV022 communication to SPI.


Read the Flash information and set the MCU parameters.
Set the PWM function, LDO, and Watchdog Timer.

AN0595EN V1.20 19 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

2. Main Loop:

(1) Enable the PWM function.


(2) Check if any key has been triggered.
→ No, go to (4).
(3) Check if the key trigger time is greater than 3 seconds.
→ Yes, execute the function defined for a long press on the triggered key.
→ No, execute the function defined for a short press on the triggered key.
(4) Check if there is a voice playing.
→ Yes, return to (2).
(5) Check if the key has reset.
→ No, return to (2).
(6) Disable the PWM function and enter the suspend mode.
(7) Check if there is a wake-up key.
→ Yes, return to (1).
→ No, continue in the suspend mode.

START

Clear RAM &


System Initia lization

Ena ble PWM Func tion

Record button press Yes Button


informa tion is triggere d ?

No
No
A custom comm and ?

Yes

Execute com mand


oper ation

Yes
Voice playing ?

No

Button No
is rese t ?

Yes

Disable PWM &


Enter suspend mode

No Button Yes
is triggere d ?

Figure 11. Direct Key Mode with Custom Control Software Flowchart

AN0595EN V1.20 20 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

1. System Initialisation:
Set the HT68FV022 communication interface to SPI.
Read the Flash information and set the MCU parameters.
Set the PWM function, LDO and Watchdog Timer.

2. Main Loop:
(1) Enable the PWM function.
(2) Check if any key has been triggered.
→ No, go to (6).
(3) Record the key information.
(4) Execute the customer_voice_code subroutine in the Customer file to check if the signal is a
custom command.
→ No, go to (6).
(5) Execute the command operation.
(6) Check if there is a voice playing.
→ Yes, return to (2).
(7) Check if the key has reset.
→ No, return to (2).
(8) Disable the PWM function and enter the suspend mode.
(9) Check if there is a wake-up key.
→ Yes, return to (1).
→ No, continue in the suspend mode.

START

Clear RAM &


System Initialization

Enable PWM Function

Vendor can Yes


A signal ?
customized it
No
Yes
Voice playing ?

No
Disable PWM &
Enter suspend mode

No Button Yes
is triggered ?

Figure 12. Custom Mode Software Flowchart

1. System Initialisation & Custom Mode Initialisation

Set the HT68FV022 communication interface to SPI.


Read the Flash information and set the MCU parameters.
Set the PWM function, LDO and Watchdog Timer.

AN0595EN V1.20 21 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

2. Main Loop:

(1) Enable the PWM function.


(2) Check if there is an input signal.
→ No, go to (4).
(3) Execute the Vendor_voice_code subroutine in the Customer file.
(4) Check if there is a voice playing.
→ Yes, return to (2).
(5) Disable the PWM function and enter the suspend mode.
(6) Check if there is a wake-up signal
→ Yes, return to (1).
→ No, continue in the suspend mode.

Software Subroutine Description

Label Function List


Label Name Description
Voice Library Subroutine
_CLRRAM Clear all RAM data
_System_Initialization Initialise the system settings
Set_Suspend Disable the functions before entering the suspend mode
Enable_WDT_LDO Enable the functions after waking up from the suspend mode
Configure_LDO Configure the LDO function
Play_Cmd_For_Customer Execute the Play operation
Stop_play_tab Execute the Stop operation
Pause_action Execute the Pause operation
Resume_action Execute the Play operation after a pause
Volume_Cmd_For_Customer Set voice volume level
Check_play_voice_state Go to the main program
Voice Library Variable
voice_ACC Store the received command or the key control value
fVoiceStandBy Voice playback state flag
fSentencePlaying Sentence playback state flag
bvoice_129 Voice number broaden variable
bhasbusy PA2 control variable
bypass_LDO LDO control variable

Note: 1. The labels in the files are interrelated with the library, therefore must not be deleted to avoid
unknown errors.

2. As the HT68FV02x_PRJ_Def.asm is used to call various library files, do not change it


unless necessary.

AN0595EN V1.20 22 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Function Description
_CLRRAM:
Clear all RAM banks
Syntax:
Call _CLRRAM
Parameters:
N/A
Return Values:
N/A

_System_Initialization
Set PA as inputs with internal pull-high and wake-up functions enabled.
Set SPI pin function.
Read the SPI Flash information including the checksum and MCU parameters such as HIRC, LVRC,
TBC, PWMC0, etc.
Set the volume to default.
Syntax:
Call _System_Initialization
Parameters:
N/A
Return Values:
N/A

Set_Suspend
Disable the Watchdog Timer, Counter, PWM and LDO functions
Syntax:
Call Set_Suspend
Parameters:
N/A
Return Values:
N/A

Enable_WDT_LDO
Enable the Watchdog Timer, Counter, PWM and LDO functions
Syntax:
Call Enable_WDT_LDO
Parameters:
Bypass_LDO
1: Disable the LDO
0: Enable the LDO
Return Values:
N/A

Configure_LDO
Configure the LDO
Syntax :
Call Configure_LDO
Parameters:
Bypass_LDO
1: Disable the LDO
0: Enable the LDO
Return Values:
N/A

AN0595EN V1.20 23 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Play_Cmd_For_Customer
Play the file of the specified address
Syntax:
JMP Play_Cmd_For_Customer
EXIT: check_play_voice_state
Parameters:
Voice_VCC
[00:7F]: Play voice 0 ~ voice 127 accordingly, a total of 128 voices
[80:DF]: Play sentence 0~ sentence 95, a total of 96 sentences
Return Values:
N/A

Stop_play_tab
Reset the playback state flag, turn off the counter and set the PWM output to 8000H
Syntax:
JMP Stop_play_tab
EXIT: check_play_voice_state
Parameters:
N/A
Return Values:
fVoiceStandBy: 1
fSentencePlaying: 0
Pin_busy: 1 (only when bhasbusy is 1 will this bit be set to 1)

Pause_action
Turn off the counter
Syntax:
Jmp Pause_action
Exit: check_play_voice_state
Parameters:
N/A
Return Values:
N/A

Resume_action
Turn on the counter
Syntax:
Jmp Resume_action
Exit: check_play_voice_state
Parameters:
N/A
Return Values:
N/A

Volume_Cmd_For_Customer
Set the volume level
Syntax:
Jmp Volume_Cmd_For_Customer
Exit: check_play_voice_state
Parameters:
Voice_ACC
Set the volume to a level value between 1 to 12
Return Values:
N/A

AN0595EN V1.20 24 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Check_play_voice_state
Return to main program and decide whether to enter the suspend mode according to if there is a voice
playing presently.
Syntax:
N/A
Parameters:
N/A
Return Values:
N/A

voice_ACC
Record the received value of the command (Interface mode) or the key (Direct mode)
fVoiceStandBy
Voice playback state flag
1: No voice is being played
0: A voice is being played
fSentencePlaying
Sentence playback state flag
1: A sentence is being played
0: No sentence is being played
bvoice_129
Voice number broaden variable - default: 0
1: Supports up to 256 voice files (0:FF)
0: Supports up to 128 voice files (0:7F)
bhasbusy
PA2 control variable - default: 1
1: When there is a voice playing, PA2 outputs low; when there is no voice playing, PA2 outputs high
0: PA2 is free for use by users
bypass_LDO
Operating voltage selection – default: 0
1: For operating voltage between 2.3~3.6V
0: For operating voltage between 3.6~5.5V

Examples

Example 1

Description:uses the “Direct key mode with custom control” interface mode. It sets a short press
on Key1 to start the voice playing and a short press on Key2 to stop the voice playing. Key3 is for
adjusting the volume.
snz voice_ACC.0 ; Key1 is triggered
jmp $+3
mov a,00h ; Play voice[0~7F]
; Play sentence[80~FF]
jmp Play_Cmd_For_Customer ; Play function label
snz voice_ACC.1 ; Key3 is triggered
jmp $+3
mov a,8 ; set volume level[1~12]
jmp Volume_Cmd_For_Customer ; Volume setup function label
sz voice_ACC.2 ; Key2 is triggered
jmp Stop_play_tab ; Stop function label
jmp check_play_voice_state ; return to main program

AN0595EN V1.20 25 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

Example 2

Description: uses “Interface mode with custom commands” interface mode. It sets a command
value lower than F0 to start playing the corresponding voice, equal to F0 to pause the playing and
F1 to resume the paused voice playing and F2 to stop the playing.
sub a,0f0h
snz voice_C
jmp Play_Cmd_For_Customer ; play voice[0~7F] or sentence[80~EF] according to the received
; command value(<F0), F0~FF to execute the following steps
xor a,00h
sz voice_Z
jmp pause_action ; if the value is F0, go to the pause function label
xor a,00h xor 01h
sz voice_Z
jmp resume_action ; if the value is F1, go to the resume function label
xor a,01h xor 02h
sz voice_z
jmp Stop_play_tab ; if the value is F2, go to the stop function label
jmp check_play_voice_state ; Return to main program

Example 3

Description: uses “Interface mode with custom commands” interface mode with voice number
broaden function enabled. After setting the voice number broaden variable, when a command value
between 00 to FF is received, the corresponding voice file between No.0 ~ 255 will be played.
set bvoice_129 ; Enable voice number broaden function
jmp Play_Cmd_For_Customer ; Play function label

Considerations

Voltage Selection
1. When selecting the Direct mode in the Voice MCU Workshop, pay attention to the VDD voltage
range selection which should match the operating voltage. In addition, if it is in the professional
mode, when VDD is greater than 3.6V the internal LDO must be enabled. When VDD is between
2.3V~3.6V the internal LDO can be bypassed. The LDO control variable was introduced in the
previous Software Description section.

AN0595EN V1.20 26 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

2. In the Finish page of the Voice MCU Workshop, when selecting the programming voltage, the
system voltage should be taken into account to make sure that the voltage levels are matched to
avoid system component damages during programming.

If the frequency list shown below in the Voice MCU Workshop is selected to be 16MHz, ensure
that VDD is greater than 3.0V.

Reference Material
Consult the HT68FV022/024 Datasheet.

For further information, see the Holtek website [Link].

Version and Modification Information


Date Author Version Modification
2022.12.05 王冠中 V1.20 New add HT68FV024 development description.
New add development environment description and development
2022.07.11 王冠中 V1.10
board introduction.
2021.09.02 王冠中 V1.00 First Version

AN0595EN V1.20 27 / 29 December 23, 2022


HT68FV022/024 Voice Application and Library Description

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. and its related companies
(hereinafter '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.

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.

AN0595EN V1.20 28 / 29 December 23, 2022

You might also like