Friday, March 15, 2013

WTV-020S Voice_wav Player Module Quick Start Guide


I admire the fast manner China based traders deliver their goods, but I cannot give the same with their support and documentation. My frustration with the WTV-020S module started right at the product brochure itself. The supplier ads mentioned that the WTV-020S module can play MP3, wav file, and can be interfaced with a host MCU in various ways. That’s all the information they provided. No manuals, no details. Trusting their ads, I gave the same information in advance to both our home page and Facebook pages.

When the first few dozen WTV-020S units arrived for our evaluation, I had a hell of a time trying to figure out how to make the thing work. Left alone by the supplier, I scourged the net and gathered from it a few fragmented information. When I finally pieced the info together, that’s when I realized that all those features listed in the ads are distributed among several variants! That is, one variant will play ad4 files only. You have to buy another module to play MP3. Another module if you want it serial control, and so on. All sorts of things that will make you want to punch somebody in the nose.

Now I am faced with an immediate problem. Which one did I buy? Not even that the supplier can tell. Actually, he does not care at all. But he, perhaps unwittingly, gave me an important clue; he said it’s the most popular model. That was just about the only useful info I got from him, but enough to get me going.

The most popular model, according to almighty Google, is the variant programmed in serial mode. Fortunately, manuals from other suppliers selling identical product are abound. These manuals obviously came from a single source; they are nearly identical, differing only with the supplier logo stamped on each page. Only they are not that helpful either. Most of its content are mere reproduction of pages from the WTV-020S IC datasheet, information not worth anything to us end users. Mercifully, by patiently piecing the info together, I finally got it working. 

I went through these difficulties so that you don’t have to. In this blog, I will guide you by discussing in brief details all the necessary tools and information you need for a quick start, and where to get them. 

WTV-02S Features
- Monophonic AD4 formatted wave file player.
- Play from FAT32 formatted microSDHC memory card.
- Serial Control, addressable playing.
- Key control – Play, Previous, Next functions
- 8 ohms speaker drive capable.



SD CARD PREPPING
File naming
Your SD card must be formatted using FAT32 file system, and the sound file must be encoded in AD4 format. The WTV-02S will play files only if named in the following format:
NNNN.AD4
Where NNNN, number filenames from 0000 to 0511
Example:
0000.AD4
0109.AD4

The WTV-020S is very strict in its file naming format implementation. It does not tolerate any deviation from it. All files not named as indicated will be ignored by the device.
The WTV-020S does not support sub folder/directories. All files must be stored at the root directory. The WTV-020S can address up to 512 ad4 files.
Converting WAV files to AD4
It would had been nice if it will play *.wav files directly, unfortunately, the folks who made this had other ideas. They wanted us to suffer. They don’t even provide the necessary conversion tools. Fortunately, one Australian company www.4dsystems.com.au made a .wav to .AD4 converter tool cut out for this purpose – ad4converter.exe.
This can be downloaded from their website

http://4d.websitetoolbox.com/file?id=898021

Fair warning: This is a DOS based command line software utility. This may trouble folks who had gotten used to the point and click way of life. If command line sounds to unfamiliar to you, make friends to someone who can help you go through it. It is actually easy to spot a DOS savvy programmer. If you hear or smell a fart in a crowd, you are not too far away from one.

A rudimentary windows based AD4 conversion tool is also available from the 4dsystems. You can download a copy by clicking this link:

http://www.4dsystems.com.au/downloads/Software/SOMO-14D%20Audio%20Converter/

Usage instructions are also provided from the provided link. Make sure you read the instructions as the utility is too shy to tell you anything, even if you are doing the conversion the terribly wrong way. For example, it will convert *.wav to *.ad4 format only if the wave file is named in the expected convention, i.e. 0001.wav, 0002.wav, etc. If the *.wav file is not correctly named, it will not generate an output AD4 file without letting you know. Just like that, no warning, no error messages.

Copy the converted files to any FAT32 formatted microSDHC memory card. Your memory card must contain only the necessary AD4 files. Sure, it will probably work even when your memory card is filled with other stuff. But I am not betting on it.

Using the WTV020S with Arduino and gizDuino MCU board


The WTV20S connects to Hosts controller using synchronous serial method of data transfer. Three hosts I/O pins are required for this interface. One I/O is used to force the WTV020S into reset state. The other two pins for the serial communication channel, one pin for the hosts generated synchronizing clock CLK, and the other pin for the host serial output data DI.

An example connection using Arduino/gizDuino Controller is hown in the following figure. The serial communication interface does not require the use of any hardware peripherals inside of Arduino/gizDuino controller, as such, users can freely reassign the pins to any I/O if it so required.



 Programming the WTV-020s: Argentina to the rescue

Frankly, after all the hardwork I went through in trying to figure out the hardware, I am in no mood to even consider writing the code. Fortunately for Arduino and gizDuino users, an Argentinean geek, calling himself the-rebel-agent, did the hard work of constructing the code libraries that allows users to access the functions and features of this module in a relatively painless way. This library can be downloaded from the official Arduino Forum:

http://arduino.cc/forum/index.php?PHPSESSID=399b4c19c1ffe5c2082eb9ae7844f928&topic=117009.0 

You will also find example programs and other useful information from the given link.

So there you are folks! Using the WTV-020s is actually quite easy. It is the lack of information that made it unnecessarily difficult to work on.


 

No comments:

Post a Comment