Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Time:2024-5-10

ASRPRO chip is a general-purpose, portable, low-power, high-performance speech recognition chip developed for low-cost offline speech applications. It adopts the third-generation BNPU technology, supports neural networks such as DNN\TDNN\RNN and convolutional operations, and supports speech recognition, voiceprint recognition, speech enhancement, speech detection, etc. It also possesses strong echo cancellation and ambient noise suppression capabilities. This tutorial will briefly introduce how to use Tianwenblock for embedded development of this chip based on the official programming manual.

I. Tianwenblock Software Download and Configuration

First of all, search for Tianwenblock in the search engine or enter the official website of Tianwenblock through the following URL, and click the “Software” link above to enter the download address.

Web site:SkyQuest Block

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Then use the installation package to install it, after the installation is complete the initial run will let you select the motherboard used, select ASRPRO.

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

After selecting, enter the programming interface

Introduction to the programming interface:Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Click on the Professional mode of the four programming modes above to program.

II. Basic program statements

1. Variables:

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Click on Create Variable and enter the name of the desired new variable in the window that appears, then click OK. (Remember to declare the new variable in the initialization area after it is created)

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Used to define the type and initial value of a new variable, the front option is used to select the declared variable, the back is used to select the type of the variable, and the initial value of the variable is defined at the back by connecting the value block, usually placed in the initialization area.

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Assigns a new value to a variable by concatenating a numeric or arithmetic block behind it.

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Getting the value of a variable to apply in a program.

2. Control:

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Delay statement for delaying a custom amount of time in a program. (Units are milliseconds and microseconds, respectively)

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

The initialization area is used to initialize the definition of variables, pins, recognizable speech, and other tools within the program, and the internal code is automatically run once after the microcontroller is powered up. The hardware peripheral initialization is applied to the initialization definition of the contents of the peripheral expansion library contained within the program.

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

The if statement determines whether or not to proceed to run a subsequent program by determining whether or not the succeeding equation is valid or whether or not a Boolean variable is true or false.

The number of repeated judgments (else if) and the inclusion of else statements in this module can be customized by using the cogwheel above.

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

The switch statement selects which part of the program to run later in the program, based on the value of the variable connected to it. You can customize the number of values (cases) you can select and decide whether to use the other value (dwfault) option by using the gears at the top.

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

base loop statement, the program loops through the interior of the region.

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Conditional loop statement, the program loops only when the conditions defined by the option and the successor arithmetic are satisfied (repeat when or repeat straightway to satisfy the arithmetic requirements), and the loop can be forcibly interrupted or selected to go on to the next loop by a program inside the diagram.

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

The for loop statement, which defines a variable, controls the number of loops by adding a predetermined value to each loop until the variable exits the loop when its value exceeds the predetermined range.

3. Functions

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Arguments in a function are defined via the upper gear and return values via the lower option selector, the upper question mark can be used for function comments, the statement used internally allows the function to return the return value early, and the single statement below is used to call a defined function from within the main function.

4. Mathematics and logic

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter 

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

This option contains a variety of statements that can be used to assign the results of logical or mathematical operations to variables or as conditions for circular judgment statements by connecting variable assignment statements or circular judgment statements on the left.

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

numerical value

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

basic arithmetic

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

With or Without and Left-Right Shift Operations

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Comparative judgment between two values

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

The operation with (and) or between two conditions

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

The opposite result of the backward conditional statement

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Random integers generated within a certain interval.

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Numerical rounding or remainder operations

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

Other complex mathematical operations

Based on the Tianwen block compilation environment ASRPRO voice chip program writing tutorial (I) software download and basic program statement chapter

This statement is used to change the type of the trailing value or the result of an operation in order to facilitate the assignment of the preceding variable.

The above is my overview combing of the SkyQuest block compilation environment and basic statements, and I will follow up with updated instruction on how to use the ASRPRO voice chip to realize various functions.

Recommended Today

ImportError: cannot import name ‘Literal‘ from ‘typing‘ (D:\Anaconda\envs\tensorflow\lib\typing.py)

Reporting Errors Background: I downgraded python 3.8 to 3.7 in my original newly created anaconda environment (mine is named tensorflow) because the tensorflow-gpu version needs to be installed. The following error occurs when importing the seaborn package: ImportError: cannot import name ‘Literal’ from ‘typing’ (D:\Anaconda\envs\tensorflow\lib\typing.py) Cause analysis: This is due to the fact that ‘Literal’ […]