HT68FV022/024 Voice MCU Overview
HT68FV022/024 Voice MCU Overview
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.
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.
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.
Overall Environment
Software
Includes Voice MCU workshop and HT-IDE3000.
Load and program the voice WAV files and configure the sentence arrangement.
HT-IDE3000
1. Power indicator.
6. Function key × 6.
8. Speaker interface.
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
1 Wire Mode
2 Wire Mode 1
Operating
Selection Method Real Product
Mode
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
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.
VDD
1 2 PA1/TC
3 4 PA2/ICPDA
5 6 PA0/INT/ICPDA
7 8 PB1/PWM2
9 10
11 12
GND
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.
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.
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.
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.
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.
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
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.
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
These files are generated in the professional mode using the Voice MCU Workshop.
START
No Yes
A valid
A signal to dec ode ?
command ?
Yes No
Yes
Voice playing ?
No
No Yes
A signal to dec ode ?
1. System Initialization:
2. Main Loop:
START
No No
No
Yes
Voice playing ?
No
No Yes
A signal to dec ode ?
1. System initialisation:
2. Main Loop:
START
Yes
No
A custom command ? A signal to dec ode ?
Yes No
Yes
Voice playing ?
No
No Yes
A signal to dec ode ?
1. System initialisation:
2. Main Loop:
START
Stop voic e or
Play voice or
incr ease volum e
Yes
Voice playing ?
No
Button No
is rese t ?
Yes
No Button Yes
is triggere d ?
1. System Initialisation:
2. Main Loop:
START
No
No
A custom comm and ?
Yes
Yes
Voice playing ?
No
Button No
is rese t ?
Yes
No Button Yes
is triggere d ?
Figure 11. Direct Key Mode with Custom Control 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.
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
No
Disable PWM &
Enter suspend mode
No Button Yes
is triggered ?
2. Main Loop:
Note: 1. The labels in the files are interrelated with the library, therefore must not be deleted to avoid
unknown errors.
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
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
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
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.
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.
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.