Hi all, I want to share working code for the WT588D sound module. The code is not a library, just a quick example hopfully to help someone get started working with these neat little devices.
The module plays sound stored on an EEPROM and is capable of driving an eight Ohm speaker at 0.5watts. The module supports more than 200 sound files in WAV format.
Quick video demo: Breadboard Sound Demo - YouTube
(The sound files are just wav files generated by a free online text to speech app,)
As far as I know, there are three modules based on the WT588D: WT588D-16P, WT588D-28P, and WT588D-U. The WT588D-U has an onboard USB programmer, while the WT588D-16P and WT588D-28P require the special USB external programmer.
A quick eBay search should show you all three modules including the external USB programmer: WT588D for sale | eBay
There is a shared Google drive with the control software to upload wav files to the devices, the user manuals, and schematics , they are well written for this type product: WT588D.rar - Google Drive
/*
This program cycles through the first eight files loaded onto a WT588D-16P Sound Module
The pins labeled on the data sheet as CLK, DI, DO, CS, REST are for programming
the module via the external USB programmer.
In the Waytronic VoiceChip beta software, the settings are configured as "Control Mode: Three Line Mode, and Busy Mode: LOW"
*/
#define WT588D_RST 7 //Module pin "REST" or pin # 1
#define WT588D_CS 6 //Module pin "P02" or pin # 11
#define WT588D_SCL 9 //Module pin "P03" or pin # 10
#define WT588D_SDA 8 //Module pin "P01" or pin # 9
#define WT588D_BUSY 10 //Module pin "LED/BUSY" or pin # 15
byte file_count = 1;
void setup() {
pinMode(WT588D_RST, OUTPUT);
pinMode(WT588D_CS, OUTPUT);
pinMode(WT588D_SCL, OUTPUT);
pinMode(WT588D_SDA, OUTPUT);
pinMode(WT588D_BUSY, INPUT);
digitalWrite(WT588D_CS, HIGH);
digitalWrite(WT588D_RST, HIGH);
digitalWrite(WT588D_SCL, HIGH);
}
void loop()
{
WT588D_Send_Command(file_count);
file_count++;
if(file_count == 8) file_count = 0;
delay(50); //give the module time to start playing
while(digitalRead(WT588D_BUSY) == 0) { }
delay(200);
}
void WT588D_Send_Command(unsigned char addr) {
unsigned char i;
digitalWrite(WT588D_CS, LOW);
delay(5); //delay per device specifications
for( i = 0; i < 8; i++) {
digitalWrite(WT588D_SCL, LOW);
if(bitRead(addr, i))digitalWrite(WT588D_SDA, HIGH);
else digitalWrite(WT588D_SDA, LOW);
delay(2); //delay per device specifications
digitalWrite(WT588D_SCL, HIGH);
delay(2); //delay per device specifications
} //end for
digitalWrite(WT588D_CS, HIGH);
} //end WT588D_Send_Command
Hope this helps!