How to create a binary for the WT588D voice module - Kyuchumimo/Micro-Joy-Home-Video-Computer GitHub Wiki

To create a binary, you will need an external program that can be found in this same repository. See: WT588D VoiceChip Beta 1.6 Setup.exe

Each time you start the program, it will display in Chinese by default, but you can change it to English if you wish in the penultimate tab. Image

The first step is to create a new project. To do this, click on the “File” tab and then select the “New Project” option. Alternatively, you can click on the New Project icon or press the F2 key.
⚠️ We recommend that you use a new folder for the project so that the files generated by the program are not scattered and using only UPPERCASE letters for the project name, since the program has a bug that prevents certain lowercase letters from being entered. Alternatively, you can enter text in a text box from another external program, then copy the text to the text field for the file name.
Once you have completed this step, you can make changes to the project.

The next step is to configure the operating mode, sound output and FLASH size of the WT588D module. For more information, see: WT588D datasheet
To open this window, go to “Operation” and select the “Options” option. Alternatively, you can click on the Options icon. Image

  • Control Mode
    The library offered in this repository is only compatible with one-line serial mode and three-line serial modes. See: lib/wt588d.py. The difference between the two is the number of pins required to establish communication, the time requirements, and the power consumption during operation, with the three-line serial mode being the better of the two. Due to the limited number of pins available on the Raspberry Pi Pico development board, not all WT588D models are compatible with three-line serial mode, and software must maintain pinout consistency, so one-line serial mode is preferable.

  • Sound Output
    The WT588D has two audio output modes: PWM and DAC. PWM is designed to directly drive 0.5W-8Ω speakers, while DAC delivers an analog signal with 13-bit resolution that can range from 0 to 3V. This DAC signal is not suitable for use in audio equipment, as the voltage range is too high and could damage it. For this reason, PWM is preferable.

  • Busy Mode
    This option is at the discretion of the software developer. The BUSY pin changes to the corresponding state 32 ms after a voice address has been called.

  • Pull High Resistor
    This option enables the internal pull-up resistors of the WT588D on pins P03, P02, P01, and P00. This option is only useful for control modes in which these inputs are operated with push buttons and nothing else, or if for some reason these pins become disconnected, which is known as a floating state input, since touching the pins with your bare hands can actually trigger commands by accident if this option is not enabled and there are no external pull-up resistors.

  • FLASH size
    This option is located in the main window of the program in an options menu. You can choose between different flash memory sizes ranging from 2 Mbit up to 32 Mbit. The Flash memory incorporated in the module comes in SOP-8 packaging. On it, you will see the model number engraved, which should start with 25 (SPI Interface Flash), followed by one or two letters and then two or three more numbers. These last numbers denote the size of the Flash memory, where "20" is for 2 Mbit, "40" for 4 Mbit, "80" for 8 Mbit, "16" for 16 Mbit, and finally "32" for 32 Mbit. In this option, you must select the lowest common denominator (2 Mbit), thus ensuring that the software is compatible with all models and modules regardless of the density of the built-in memory.

The next step is to load sound files into the program.
Image

⚠️ To load a sound file, it must have a sampling frequency between 6 and 22 kHz and be in WAV format. Otherwise, a window will appear displaying an error message, or it will not appear in the file explorer window for selection. You can edit audio with an external program such as Audacity.

The left side is where sound files are loaded, the middle column defines the voice address, and the right side is where you can assign one or a series of sound files to a voice address. The WT588D module has space for up to 220 voice addresses.

Finally, when you have finished loading and assigning the voices, it is time to compile a binary. This is done from the “Compile (Save BIN)” option in the “Operation” tab. Alternatively, you can click on the Compile icon or press the F4 key.
Once the operation is complete, the binary will be located in [PROJECT_NAME].winproj/[PROJECT_NAME].winproj.bin, where you can load it into the module's built-in Flash memory using the corresponding tool found in this repository. See: How to write to an external memory
⚠️ Note: The built-in Flash memory of the WT588D module can be written to even when the microcontroller is powered (VDD). It is necessary to keep the reset pin low during the writing process and then de-initialize the pins that have been used by the development board once the process is complete so that the WT588D microcontroller can access the Flash, remember that an SPI peripheral can only have one master. Finally, restart the WT588D microcontroller to initialize the new data in order to use it again. For reference, the initial state of all pins on the RP2040/2350 microcontroller is mode=IN, pull=None.