HOLTEK HT32 Voice Tool User Guide
- June 4, 2024
- HOLTEK
Table of Contents
- HOLTEK HT32 Voice Tool User Guide
- 1. Development Environment
- 1.3 Hardware
- 1.3.2 Hardware Output Resources
- 2. HT32 Voice Tool Main Interface
- 3. New Project
- 3.2 Voice Configuration
- 3.2.2 WAV file sampling rate limitation
- 3.3.2 Function Introduction 2
- 3.3.3 Function Introduction 3
- 4. Function Library Description
- 5. Appendix
- MEMORY MAP
- Copyright© 2021 by HOLTEK SEMICONDUCTOR INC.
- Read More About This Manual & Download PDF:
- Read User Manual Online (PDF format)
- Download This Manual (PDF format)
HOLTEK HT32 Voice Tool User Guide
1. Development Environment
1.1 Overall Environment
I. HT32 Voice Tool
Development Board Speaker
II. KeilTM MDK-ARM
1.2 Software
This includes the HT32 Voice Tool and the KeilTM MDK-ARM μVision5.
1.2.1 HT32 Voice Tool
- MCU selection, external SPI Flash Memory capacity selection, loading and setting voice WAV, sentence configuration settings.
- MCU program compiling, SPI Flash data compiling and MCU/SPI Flash data downloading function.
1.2.2 KeilTM MDK-ARM μVision5
- The KeilTM MDK-ARM μVision5 is used to set and view the source code, which can be downloaded to the development board.
- The HT32 Voice Tool is required with the KeilTM MDK-ARM μVision5. Ensure that the KeilTM MDK-ARM μVision5 and KeilTM HT32 support packages have been installed before using the
HT32 Voice Tool.
1.3 Hardware
The development board is used together with the HT32 Voice Tool for
development.
(The following HT32 development board product No. can be used together with
HT32 Voice Tool.)
HT32F52341
HT32F52241
HT32F52253
HT32F52354
HT32F52367
HT32F50343
HT32F52352
HT32F50241
HT32F57341
HT32F57352
HT32F0008
HT32F12366
HT32F12345
HT32F12364
1.3.1 Development Board Introduction
-
USB_B: e-Link32 Lite – for downloading program/data and emulation
-
GPIO / Expansion connector
-
GPIO / Expansion connector
-
Download connector
-
SWD-10P connector
-
Reset key
-
USB_A: HT32F0006 USB interface
-
Speaker output jack
-
HT82V742 amplifier IC
-
PWM output selection
-
SPI interface
-
SPI Flash
-
Demo function keys
1.3.2 Hardware Output Resources
The MCU product No. based around an M0+ processor core, PWM Timer, PWM I/O and SPI pins are shown in the following table.
| Timer| Supported IC| PWM I/O| SPI (SCK/MOSI/MISO/CS)
---|---|---|---|---
M0+
|
GPTM 0
| HT32F52341| PA5/PA7 (PWM 2A/PWM 2B)| PA0/PA1/PA2/
PB9 (Program output signal)
HT32F52241| A5/A7(PWM B) (PWM 2A/PWM 2B)| PA0/PA1/PA2/
PB9 (Program output signal)
HT32F52253| PA2/PA3 (PWM 1A/PWM 1B)| PB3/PB4/PB5/PA7
HT32F52354| PC4/PC5 (PWM 1A/PWM 1B)| PA0/PA1/PA2/PA7
HT32F52367| PC4/PC5 (PWM 1A/PWM 1B)| PD11/PD12/PD13/PD5
HT32F50343| PC4/PA3 (PWM 1A/PWM 1B)| PB3/PB4/PB5/PC5
GPTM 1| HT32F52352| PA2/PA3 (PWM 1A/PWM 1B)| PC5/PC8/PC9/PA7
PWM 1
| HT32F50241| PC4/PC5 (PWM 1A/PWM 1B)| PB3/PB4/PB5/PA7
HT32F57341| PD4/PD5 (PWM 1A/PWM 1B)| PC5/PC8/PC9/PC4
HT32F57352| PD4/PD5 (PWM 1A/PWM 1B)| PC5/PC8/PC9/PD7
HT32F0008| PC4/PC5 (PWM 1A/PWM 1B)| PA0/PA1/PA2/PA7
The MCU product No. based around an M3 processor core, PWM Timer, PWM I/O and SPI pins are shown in the following table.
| Timer| Supported IC| PWM I/O| SPI (SCK/MOSI/MISO/CS)
---|---|---|---|---
M3
| MCTM1| HT32F12366| PE1/PE5 (PWM 1A/PWM 1B)| PD10/PD11/PD12/PD6
GPTM 1| HT32F12345| PA0/PA1 (PWM 3A/PWM 3B)| PC10/PC11/PC12/PC9
GPTM 0| HT32F12364| PC9/PC10 (PWM 1A/PWM 1B)| PA4/PA5/PA6/PA1
2. HT32 Voice Tool Main Interface
2.1 Software Functions Introduction
- New project/Open project /Save project
- Function setting(Voice/Sentence)
- Generate the corresponding project
- Download functions: download the generated project to an internal Flash or external SPI Flash
- Interface language switching: supports three language options which are English, Simplified Chinese and Traditional Chinese
- “About”: Display software version information
3. New Project
3.1 New Project
Step 1: Click the “New Project” icon
Step 2: Set the project name
Step 3: Set the project path
Step 4 : Select the MCU
Step 5 : Select the voice data location
Step 6: Click the “OK” button
3.2 Voice Configuration
3.2.1 Function Introduction
Step 1: Click the “Voice” icon
Step 2: Click the button to delete the WAV
Step 3: Click the button to load the WAV into the project
Step 4: Select the WAV file to add
3.2.2 WAV file sampling rate limitation
HT32F0008 => 6kHz ~ 16kHz
HT32F12345 => 6 kHz ~ 44.1kHz
HT32F12364 => 6kHz ~ 44.1kHz
HT32F12366 => 6kHz ~ 44.1 kHz
HT32F50241 => 6kHz ~ 11.025kHz
HT32F50343 => 6kHz ~ 22.05kHz
HT32F52241 => 6kHz ~ 22.05kHz
HT32F52253 => 6kHz ~ 22.05kHz
HT32F52341 => 6kHz ~ 16kHz
HT32F52352 => 6kHz ~ 32kHz
HT32F52354 => 6kHz ~ 16kHz
HT32F52367 => 6kHz ~ 22.05kHz
HT32F57341 => 6kHz ~ 22.05kHz
HT32F57325 => 6kHz ~ 22.05kHz
When the sampling rate exceeds the limitation, it will be automatically re-
sampled to the highest or lowest sampling rate.
3.3 Sentence Configuration
3.3.1 Function Introduction 1
Step 1: Click the “Voice” icon
Step 2: Select the WAV file to add
3.3.2 Function Introduction 2
Step 1 : Click the “Sentence” icon
Step 2 : Click the button to add a new sentence
Step 3: Click the button to delete the sentence
Step 4: Select the sentence1 to configure the sentence1 content
Step 5: New action
Step 6: Delete an action
Step 7: Set the action and select “Play Voice/Mute”
Step 8 : Set the voice/mute time
3.3.3 Function Introduction 3
Step 1 : Copy sentence function
Step 2 : Click the button to copy the Sentence0
Step 3: Automatically insert the copied sentence (Sentence0(1))
Step 4: Click the “Finish” button to finish the settings
Step 1: Modify the sentence name function
Step 2 : Modify the sentence name
Step 3: Click the “Finish” button to finish the settings
Step 1 : Insert sentence function
Step 2: Click the button to insert the sentence
Step 3: Automatically insert a sentence (Sentence1)
Step 4: Click the “Finish” button to finish the settings
3.4 Generate Project and HT32 Voice Data
Step 1 : Click the “Generate” icon
Step 2: Select [set keil path].
Step 3: Select the keil path
3.5 Download Function
3.6 Open Project
Users can open or switch to the HT32 Voice project by clicking the “Open” icon.
Step 1: Click the “Open” icon
Step 2: Select the project “xxxx.hvw” to open (the last saved project
path is used automatically by default), such as Project.hvw
Step 3 : Click the “Open” icon to enter the operating interface to
complete the open project
Step 4: When opening the project, the project path is shown in the
information column below
4. Function Library Description
4.1 Voice Library Description
The voice library contains three files in the following table.
File Name | Description |
---|---|
HT32Voice.lib | Voice library |
VOICELib.h | Variables and function declarations used in library functions |
typedef.h | Variable type definitions used in the project |
4.2 Play Functions
Functions | Description |
---|---|
void VOICE_VolumeDown(void) | The volume turns down a step |
void VOICE_VolumeUp(void) | The volume turns up a step |
void VOICE_Stop(void) | Stop playing voice |
void SENTENCE_Stop(void) | Stop playing sentence |
FlagStatus VOICE_Finish(void) | Finish playing voice |
void VOICE_Resume(void) | Resume playing voice |
void VOICE_Pause(void) | Pause playing voice |
void PLAY_SENTENCE(u32 index, u32 volume) | Play sentence |
void PLAY_VOICE(u32 index, u32 volume) | Play voice |
4.2.1 Play Functions (User Function) void VOICE_VolumeDown(void)
Description: The volume turns down a step void VOICE_VolumeUp(void)
Description: The volume turns up a step void VOICE_Stop(void)
Description: Stop playing voice void SENTENCE_Stop(void)
Description: Stop playing sentence
FlagStatus VOICE_Finish(void)
Description: Determine if the voice has finished playing void
VOICE_Resume(void)
Description: Resume playing voice void VOICE_Pause(void)
Description: Pause playing voice void PLAY_SENTENCE(u32 index, u32 volume)
Description: Play sentence
Parameters: u32 index: Which sentence to add when entering a sentence
(HT32 voice tool number starting with 1, the program number starting with 0)
u32 volume: The input function volume value (the number ranges from 0 to 88,
the minimum voice volume value is 0, and the maximum voice volume value is
88), determine the volume when the sentence is played. void PLAY_VOICE(u32
index, u32 volume)
Description: Play voice Parameters: u32 index: Which voice to add when
entering a voice
(HT32 voice tool number starting with 1, the program number starting with 0)
u32 volume:
The input function volume value(the number ranges from 0 to 88, the minimum
voice volume value is 0, and the maximum voice volume value is 88), determine
the volume when the voice is played.
4.3 Other Descriptions
4.3.1 Resource Occupancy
- The voice library is suitable to HT32 MCU. Two points should be noted when selecting an MCU:
1.Basic frequency: note that if the decoding speed of a frame of voice is less than play speed, a play error will occur. The length of a frame = 320/Sample Rate(s)
2. Flash: Pay attention to the voice resource capacity and ensure that there is no overflow of internal Flash or selecting external Flash.
| Resource Type| Capacity
---|---|---
Decode| Flash| about 15 KB
SRAM| about 3.5 KB
4.3.2 Voice Decoding Speed
Taking the HT32F52354 as an example, measure the decoding speed of a frame of
320-bit voice data.
• The decoding speed of a frame of voice is shown in the following table.
Frame-Format| Basic Frequency (48 MHz)| Basic Frequency
(40 MHz)| Basic Frequency (20 MHz)
---|---|---|---
160-bit| 4.7 ms| 5.7 ms| 11.3 ms
240-bit| 4.9 ms| 5.9 ms| 11.8 ms
320-bit| 5.0 ms| 6.0 ms| 12.0 ms
480-bit| 5.2 ms| 6.3 ms| 12.5 ms
640-bit| 5.4 ms| 6.5 ms| 13.0 ms
5. Appendix
5.1 Program Flow
Provide a program flow for reference in the following diagram
5.2 Development Board Schematic Diagram
| Supported IC| SK CN4| Pin
---|---|---|---
M0+
| HT32F52341| PWM 2A/PWM 2B| 6/12
HT32F52241| PWM 2A/PWM 2B| 6/12
HT32F52253| PWM 1A/PWM 1B| 13/14
HT32F52354| PWM 1A/PWM 1B| 13/14
HT32F52367| PWM 1A/PWM 1B| 13/14
HT32F50343| PWM 1A/PWM 1B| 13/14
HT32F52352| PWM 1A/PWM 1B| 13/14
HT32F50241| PWM 1A/PWM 1B| 13/14
HT32F57341| PWM 1A/PWM 1B| 13/14
HT32F57352| PWM 1A/PWM 1B| 13/14
HT32F0008| PWM 1A/PWM 1B| 13/14
| Supported IC| SK CN4| Pin
---|---|---|---
M3
| HT32F12366| PWM 1A/PWM 1B| 13/14
HT32F12345| PWM 3A/PWM 3B| 21/22
HT32F12364| PWM 1A/PWM 1B| 13/14
5.3 Modify Timer Settings for Teaching
5.3.1 Call PWM_CONFIG
- Modify the registers and interrupt settings according to the memory map section in this user manual.
MEMORY MAP
5.3.2 Modify the pin settings according to the pin assignment in
datasheet
Table 3. HT32F57331/HT32F57341 Pin Assignment
Copyright© 2021 by HOLTEK SEMICONDUCTOR INC.
The information appearing in this Data Sheet is believed to be accurate at the time of publication. However, Holtek assumes no responsibility arising from the use of the specifications described. The applications mentioned herein are used solely for the purpose of illustration and Holtek makes no warranty or representation that such applications will be suitable without further modification, nor recommends the use of its products for application that may present a risk to human life due to malfunction or otherwise. Holtek’s products are not authorized for use as critical components in life support devices or systems. Holtek reserves the right to alter its products without prior notification. For the most up-to-date information, please visit our web site at http://www.holtek.com.
Read More About This Manual & Download PDF:
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>