255-Voice PCM Sound Generator. Part 2. Software

Part 1. Schematic

Supported Sound Formats and Control Commands

Supported sound file format is RIFF/WAVE in LPCM, 8/16bit, mono/stereo and 8kHz-48kHz. Any other sound files, such as ADPCM, MP3 and AAC, must be converted into the PCM. The sound files must be named NNN.wav. The NNN is three digit number in range from 001 to 255. The sound files must be put into the root directory.

The control command is input as binary code by eight contacts (SW1-SW8) and the corresponding sound file will be played. e.g. SW1 corresponds to 001.wav, SW4 corresponds to 008.wav and SW1+SW5 corresponds to 017.wav.

Trigger Mode (Operating Modes)

There are four operating modes, behavior of the sound generator on control command, can be configured by 000.txt. Each mode works as follows:

  • Mode 0 : Level trigger. Plays a sound file corresponds to the input code in auto-repeat. When the input code is changed, the sound also be changed. When the input goes off(0), the audio output is stopped.
  • Mode 1 : Level trigger (sustained). Same as mode 0 but the file is played until end of the file and then stopped when the input goes off.
  • Mode 2 : Edge trigger. Plays a sound file corresponds to the input code once. Any code change while a sound will be ignored.
  • Mode 3 : Edge trigger (re-triggerable). Same as mode 2 but the code change is accepted while the sound. To re-rtigger with the same code, return 0 and input the code again.

Remember. The firmware to be written into the AVR must be fit for the output configuration of the circuit. Each output configuration (Mono-OCL/Stereo/Mono-HR) correcponds the hex file (sdsg_mo.hex/sdsg_st.hex/sdsg_hr.hex). The fuse settings are combined with the hex files, however, some flash programmer does not support this sort of hex files. In this case, remove last three lines from the hex file and initialize the fuse bits separately with the fuse values found in main.c


Configuration File 000.txt - download
GCC project and hex files - download


JLCPCP: 2USD 2Layer 5PCBs, 5USD 4Layer 5PCBs

You may have to register before you can post comments and get full access to forum.
User Name
Fragments of discussion:Full version of discussion »
  • What way changed next commands generator # Trigger mode (0..3) # 0:Level triggered # 1:Level triggered (sustained) # 2:Edge triggered # 3:Edge triggered (retriggerable Please make algorithm for above to changing mode and what mode by Default
  • See configuration file 000.txt. It's must be put into the root directory of SD memory card.
PCB Design Analysis Software-NextDFM One-click Design Analysis for Manufacturability Layout Engineer Free Forever