Arduino Forum

Using Arduino => Audio => Topic started by: SugarBombs on Mar 21, 2014, 07:43 am

Title: WT588D-16P Sound Module Working Code
Post by: SugarBombs on Mar 21, 2014, 07:43 am
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: http://www.youtube.com/watch?v=7RrWNjpomxs&feature=youtu.be
(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: http://www.ebay.com/sch/i.html?_trksid=p2047675.m570.l1313&_nkw=WT588D&_sacat=0&_from=R40

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: https://docs.google.com/open?id=0B2_rhDNAxM4sbmRtM2dXM2ZxWUE

Code: [Select]
/*

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!
Title: Re: WT588D-16P Sound Module Working Code
Post by: Zapro on Mar 21, 2014, 08:33 am
How about this page, it links a different zip which contains complete documentation:
http://www.emartee.com/product/41694/WT588D%20U%20WAV%20USB%20Module (http://www.emartee.com/product/41694/WT588D%20U%20WAV%20USB%20Module)

// Per.
Title: Re: WT588D-16P Sound Module Working Code
Post by: JakeSoft on Mar 21, 2014, 10:58 pm
Thank you for posting this information. I have recently started trying to integrate a WT588D-u (the one with built-in USB for programming). It's been a real source of frustration. I can't get it to make a peep even in the stand-alone KEY mode. I also tried to interface it with a Pro Mini 3.3v with 3-line serial and still nothing.

What kinds of issues did you run into while getting started with this module? How is the sound quality? (I wouldn't know, mine doesn't work!)
Title: Re: WT588D-16P Sound Module Working Code
Post by: Zapro on Mar 21, 2014, 11:10 pm

What kinds of issues did you run into while getting started with this module? How is the sound quality? (I wouldn't know, mine doesn't work!)


Where did you get the idea that i have the module ? I just googled a bit for you, that's all.

// Per.
Title: Re: WT588D-16P Sound Module Working Code
Post by: JakeSoft on Mar 22, 2014, 04:11 pm
Quote
Where did you get the idea that i have the module ? I just googled a bit for you, that's all.


My comments were directed to SugarBombs, the original poster. He obviously has some experience with the module.
Title: Re: WT588D-16P Sound Module Working Code
Post by: Zapro on Mar 22, 2014, 04:55 pm

My comments were directed to SugarBombs, the original poster. He obviously has some experience with the module.


Oops, sorry mate  :smiley-red:

// Per.
Title: Re: WT588D-16P Sound Module Working Code
Post by: JakeSoft on Mar 23, 2014, 06:22 pm
No worries.

SB, would you care to elaborate on how you have this wired in your video. It looks like you have lines run from the programmer to your breadboard while the unit is in operation. Is this just so you can program the WT588D chip without taking it off your breadboard? Also, it looks like you've got a transistor wired to pin 14? (I can't really tell which pin in the video, but it looks close to that). Why is was that necessary?
Title: Re: WT588D-16P Sound Module Working Code
Post by: JakeSoft on Mar 23, 2014, 10:46 pm
I got it to work after all! It ended up being some kind of software corruption problem. Apparently, if you start your sound project in "key" mode then change it to serial mode and then back to key mode something gets messed up. I was able to start a new project and get everything working.

Some extra news to add is that you can drive the serial interface with 3.3v logic. It looks like SB was using a Nano which operates at 5v. I got it to work with a Pro Mini 3.3v.
Title: Re: WT588D-16P Sound Module Working Code
Post by: JakeSoft on Mar 29, 2014, 01:45 am
It seems to work pretty well in my project so far. Now I want to make it louder.

The unit itself is capable of outputting 0.5 Watts of power with an 8 Ohm load. I'd like to get ~1 Watt @ 8 Ohms. Anyone have any ideas? I've got limited space in my project so I don't have room for a ton of huge capacitors or complicated amplifier circuitry. I wonder if I could use a linear amplifier chip like this one:
http://www.digikey.com/product-detail/en/LM386N-4%2FNOPB/LM386N-4%2FNOPB-ND/148192

Title: Re: WT588D-16P Sound Module Working Code
Post by: RdlB on Apr 19, 2014, 10:09 am
Thanks SugarBombs and community for sharing your experience!
It sure helped me in my learning process. I am not a technician, nor a programmer. I try to learn by reading, watching Youtube and other videos and doing some experiments. In my home now and then some volcanic activity takes place. A typical weird smell and white smoke fills my room, driving my heartbeat to the max. Bringing me down, but also motivates me stronger than before to go further and not give up.
I am searching for some example code on how to play certain sound samples from WT588D memory. E-mail communication with the manufacturer of the board was not successful, although they tried to help by sending documentation. As they unfortunately did not have any experience with Arduino they were not able to help me any further.
I hope to find some Tom Thumb bread crumbs here...
Title: Re: WT588D-16P Sound Module Working Code
Post by: wildjack6 on Dec 10, 2014, 02:56 am
Wandering if anyone else has any sample code for this module I can get it to play but when trying to get it to play I keep hitting road blocks
Title: Re: WT588D-16P Sound Module Working Code
Post by: forsytjr on Feb 23, 2015, 04:17 am
Is the non-usb model only programmable by buying that external programmer?  Or can you program it using a USB-UART connection? 
Title: Re: WT588D-16P Sound Module Working Code
Post by: Protonerd on Mar 13, 2015, 10:26 pm
I was actually wondering about the same as forsytjr, I already ordered the two modules wo/USB, I'm very hopeful that there is a way to bypass an external programmer.

Anyone out there maybe already have a working solution for this? :smiley-eek:
Title: Re: WT588D-16P Sound Module Working Code
Post by: PhantomLAX on Jun 08, 2015, 04:44 pm
in my project i am trying to be able to talk to my project to activate different controls, is this feasible
Title: Re: WT588D-16P Sound Module Working Code
Post by: poiuycat on Jun 09, 2015, 08:42 pm
that is very simple , all you need to do is use that application created the bin file.
and then write into the flash just same like how you write to the flash chip. :)

http://www.instructables.com/id/How-to-Design-with-Discrete-SPI-Flash-Memory/

ps: pull reset to low before download the file.
Title: Re: WT588D-16P Sound Module Working Code
Post by: WilliamKwan on Jun 15, 2015, 10:25 am
Can anyone tells me  why my stuff can't working  .i use three wire  serial interface mode to connect with arduino mega 2560 and my  buzzer did not have sound ,besides  i have  using Lm386 to be  power amplifier to make sound loud .   I  am  confuse ..   does the host code has wrong  or i use wt588d  wrong way
Title: Re: WT588D-16P Sound Module Working Code
Post by: Spuznik on Aug 25, 2015, 05:30 am
I found that the example code only works if you have the soundfiles in the first "playlist" 0.

If you connect the arduino as per the model of WT588D you are using. I found this document to be very helpful as the pins locations vary. http://www.waytronic.com/DownLoadCenter/2011825103320760.pdf

Using the pins as per the pdf and the code provided by SugarBombs I was able to get the audio working.

Just make sure you match arduino pins to WT588D pins as per the code.  You can change the the arduino pins by updating the pin in the #define statements

#define WT588D_SDA 8 //Module pin "P01" or pin # 9  (Pin 8 on the arduino and P01 on the WT588D)
Title: Re: WT588D-16P Sound Module Working Code
Post by: purgedsoul on Oct 10, 2015, 04:57 am
Is the non-usb model only programmable by buying that external programmer?  Or can you program it using a USB-UART connection? 
I was actually wondering about the same as forsytjr, I already ordered the two modules wo/USB, I'm very hopeful that there is a way to bypass an external programmer.

Anyone out there maybe already have a working solution for this? :smiley-eek:
Hi Guys, I am in the same boat as forsytjr and Protonerd. I got this module, but alas I cannot get the programmer locally, since the local seller only carried the non USB model, and he has no programmer available.

that is very simple , all you need to do is use that application created the bin file.
and then write into the flash just same like how you write to the flash chip. :)

http://www.instructables.com/id/How-to-Design-with-Discrete-SPI-Flash-Memory/

ps: pull reset to low before download the file.
Hi poiuycat, were you able to do it with the non USB module. The above instructables, seems to target winbond flash memory chips, I am not sure if it will be compatible with the flash chip on the wt588d module.
Title: Re: WT588D-16P Sound Module Working Code
Post by: purgedsoul on Oct 13, 2015, 05:47 pm
Well, i tried using poiuycat's instructables link. No response to the command get_jedec_id. I connected the SPI pins accordingly via CD4050 (except MISO, directly connected to the pro mini's pin12), also connected the RESET to GND. Sigh.

I'm using a 5V arduino by the way.
Title: Re: WT588D-16P Sound Module Working Code
Post by: purgedsoul on Nov 02, 2015, 08:37 am
Just an update for those trying to program this module without the programmer. I was able to connect to the module's SPI Flash. It is Winbond compatible, mine was KH25L8006E (the datasheet I can find was of MX25L8006E). I ended up using AdaFruit's TinyFlash library for programming the trinket audio player, modified the code to just upload bin file to the flash.I was able to upload the .bin file, but somehow it will not play. Oh well, back to the drawing board.
Title: Re: WT588D-16P Sound Module Working Code
Post by: purgedsoul on Nov 06, 2015, 08:43 am
EUREKA! Okay, finally got to program this module. For those brave enough to do it, I have attached the code. It uses a processing sketch to communicate with the firmware loaded on the arduino. Code is not optimized, no error checking, hence USE AT YOUR OWN RISK. Feel free to modify.

My setup is a deek-robot Arduino pro Nano 3.3V. You can use an Arduino with 5 V but you need level shifting with the WTD588D. Standard hardware SPI pins used. 11, 12, 13, 10.

Video of the uploading in progress (https://youtu.be/vATVLe_D52w)

Arduino Firmware:
_____________________________________________________
Code: [Select]
// Winbond serial flash loader.  Runs on normal Arduino (e.g. Uno,
// NOT Trinket), works with 'AudioXfer' Processing code on host PC.
// Modified by purgedsoul for uploading bin file to WTD588-16P sound module.
// Use at your own risk!

#include <Adafruit_TinyFlash.h>
#include <SPI.h>

//#define LED A0

// Blink LED (not pin 13) to indicate flash error
/*void error(uint32_t d) {
  for(;;) {
    digitalWrite(LED, HIGH);
    delay(d);
    digitalWrite(LED, LOW);
    delay(d);
  }
}
*/

void setup() {
  Adafruit_TinyFlash flash;
  
  uint8_t            buffer[256];
  
  int                c, index      = 0,
                     rmdr          = 0,
                     numpages      = 0,
                     page          = 0;
                    
  uint32_t           capacity,
                     address       = 0,
                     bytesExpected = 0x7FFFFFFF,
                     bytesReceived = 0,
                     filesize=0;

//  pinMode(LED, OUTPUT);
//  digitalWrite(LED, LOW);

  Serial.begin(57600);
  Serial.println("HELLO");      // ACK to host

  capacity = flash.begin();
  Serial.println(capacity);     // Chip size to host
//  if(!capacity) error(250);     // Fast blink

  

  while(!Serial.find("ERASE")); // Wait for ERASE command from host
  if(!flash.eraseChip()) {
    Serial.println("ERROR");
//    error(500);                 // Slow blink
  }
  
//while(Serial.available() == 0) {}
   while(!Serial.find("CAPACITY"));
    filesize = Serial.parseInt();
  
    numpages = filesize / 256;
    rmdr = filesize % 256;
    
    if(rmdr != 0) numpages = numpages + 1;
    
  Serial.println("READY");      // ACK to host

  for(;;) {
    // Buffer data until a full page is ready or last packet arrives.
    if((c = Serial.read()) >= 0) {
      buffer[index] = c;
      index=index+1;
      if((index >= sizeof(buffer))) {
        if(flash.writePage(address, buffer)) {
          
//          digitalWrite(LED, HIGH);
          Serial.print('.');
        } else {
          Serial.print('X');
        }
        
//        digitalWrite(LED, LOW);
        if(page >= numpages) break; //(address >= capacity) ||
        index = 0;
        page = page + 1;
        address = address + sizeof(buffer);
      }//if ((index >= sizeof(buffer)))
    } //if ((c = Serial.read()) >= 0)
  } //for(;;)
  //if filesize > 0
} // void setup()

void loop() { }



Processing Sketch
_____________________________________________________________
Code: [Select]
/ WT588D .bin file transfer.  Runs in conjunction with
// AudioLoader_WT588D.ino sketch on Arduino
// Processing sketch based off AdaFruit AudioXfer sketch
// Use at your own risk

import processing.serial.*;
Serial  port = null;

int     capacity;
boolean done = false;

// Wait for line from serial port, with timeout
String readLine() {
  String s;
  int    start = millis();
  do {
    s = port.readStringUntil('\n');
  } while((s == null) && ((millis() - start) < 3000));
  return s;
}

void setup() {
  String s;
  background(0);
  size(300, 150);                                 // Serial freaks out without a window :/

  // Locate Arduino running AudioLoader sketch.
  // Try each serial port, checking for ACK after opening.
  
  println("Scanning serial ports...");
   for(String portname : Serial.list()) {
    try {
      portname = "COM13";                        // bypass scan
      port = new Serial(this, portname, 57600);
    } catch (Exception e) {                      // Port in use, etc.
      continue;
    }
    print("Trying port " + portname + "... ");
    if(((s = readLine()) != null) && s.contains("HELLO")) {
      println("OK");
      break;
    } else {
      println();
      port.stop();
      port = null;
    }
  }

  if(port != null) {                              // Find one?
    if(((s        = readLine())                != null)
      && ((capacity = Integer.parseInt(s.trim())) > 0)) {
      println("Found Arduino w/" + capacity + " byte flash chip.");
      selectInput("Select a file to process:", "fileSelected");
    } else {
      println("Arduino failed to initialize flash memory.");
      done = true;
    }
  } else {
    println("Could not find connected Arduino running WT588DAudioLoader sketch.");
    done = true;
  }
}

void fileSelected(File f) {
  if(f == null) {
    println("Cancel selected or window closed.");
  } else {
    println("Selected file: " + f.getAbsolutePath());
    byte input[] = loadBytes(f.getAbsolutePath());

    int filesize = input.length;
    
    
      port.write("ERASE");                          // Issue erase command now, process audio while it works

      println("Processing file...\n");
                
      print("Erasing flash...");                    // Really just waiting for the erase ACK
      
      String s, cap;
      int c;
      
      cap = "CAPACITY" + filesize;
      port.write(cap);
                  
      while(((s = readLine()) == null) || (s.contains("READY") == false));
      
      print("\nFilesize: ");
      println(cap);
      print("OK\nWriting...\n");
      // Instead of just write(output), it's done per-byte so we
      // can echo progress dots from the Arduino to the console.
      // Eventually may want to make it re-write error sectors.
    
      for(int i=0; i<filesize; i++) {
        //a = input[i]; //& 0xff;
        port.write(input[i]);
              
        if((c = port.read()) >= 0) {print((char)c);}
      }
      println("done!");
    
    }
 
   done = true;
  
}

void draw() {
  if(done) exit();
}


Title: Re: WT588D-16P Sound Module Working Code
Post by: ecloud on Nov 25, 2015, 09:49 am
Hi,

for anyone interested I extend the code a little to a library and made a git repository.
See https://github.com/ACDCLabs/WT588D.git

It's far from being a perfect well designed library, but rather a start for further contributions.

I spend some time flashing the chip with an Arduino and SPI directly, with mixed success.
Flashing the chip produces several write errors during flashing, but worked occasionally. 

N.
Title: Re: WT588D-16P Sound Module Working Code
Post by: purgedsoul on Nov 30, 2015, 01:59 pm
Finally a library, thank you ecloud.
Title: Re: WT588D-16P Sound Module Working Code
Post by: raphax on Dec 08, 2015, 05:24 am
Help, do you have a scheme to power and upload the songs on a wt588d-16p?
Title: Re: WT588D-16P Sound Module Working Code
Post by: smanettone on Dec 27, 2015, 12:57 pm
Hi PurgedSoul,
thank you for your precious informations.

I tried your code on my Arduino Uno and connected the WT588D to the Arduino's SPI pin (with level shifter 5V to 3,3V), but i have "0" as "capacity" (println) all the time, can't get differente values.

Do you have some hint for me?

Thank you in advice!
Title: Re: WT588D-16P Sound Module Working Code
Post by: purgedsoul on Dec 28, 2015, 08:15 am
@smanettone

can you query your WT588D flash chip's ID and capacity? In the Adafruit_Tiny library the flash's capacity is hardcoded and will only recognized chips whose ID and capacity is such:

   
Code: [Select]
return ((manID == 0xC2) && (devID == 0x13)) ? CHIP_BYTES : 0L;

Flash that is not recognized will always return a 0.

Title: Re: WT588D-16P Sound Module Working Code
Post by: smanettone on Dec 28, 2015, 10:47 am
@smanettone

can you query your WT588D flash chip's ID and capacity?

How can i do that?



I'm sorry, but i need to learn a lot of things about Arduino yet :p this is my first project.
Title: Re: WT588D-16P Sound Module Working Code
Post by: purgedsoul on Dec 29, 2015, 10:22 am
How can i do that?



I'm sorry, but i need to learn a lot of things about Arduino yet :p this is my first project.

Try running this sketch and check the output of get_jedec_id in serial monitor:

Code: [Select]
/*
    windbond_serial_debug.cpp
    A simple program for the Arduino IDE to help familiarize you with
    using WinBond flash memory; can also be used to download the entire
    contents of a flash chip to a file via a serial port interface.
   
    Important bits of the code: the low-level flash functions (which
    implement the timing diagrams in the datasheet), and a simple
    serial-port command interface that allows you to talk to your
    UNO with any generic terminal application (even the command line).
   
    Copyright 2014, Peter J. Torelli

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>   

Revisions:
    rev 2 - 21-SEP-2014.
    User 'fiaskow' pointed out that driving the WEL instruction after
    program and erase w/o waiting for the op to finish may be corrupting
    execution. Removed this code (also not needed b/c the WEL is already
    cleared after page write or chip erase).
*/
#include <Arduino.h>
#include <SPI.h>

// SS:   pin 10
// MOSI: pin 11
// MISO: pin 12
// SCK:  pin 13

// WinBond flash commands
#define WB_WRITE_ENABLE       0x06
#define WB_WRITE_DISABLE      0x04
#define WB_CHIP_ERASE         0xc7
#define WB_READ_STATUS_REG_1  0x05
#define WB_READ_DATA          0x03
#define WB_PAGE_PROGRAM       0x02
#define WB_JEDEC_ID           0x9f
#define WB_SECTOR_ERASE       0x20

/*
================================================================================
User Interface Routines
The functions below map to user commands. They wrap the low-level calls with
print/debug statements for readability.
================================================================================
*/

/*
 * The JEDEC ID is fairly generic, I use this function to verify the setup
 * is working properly.
 */
void get_jedec_id(void) {
  Serial.println("command: get_jedec_id");
  byte b1, b2, b3;
  _get_jedec_id(&b1, &b2, &b3);
  char buf[128];
  sprintf(buf, "Manufacturer ID: %02xh\nMemory Type: %02xh\nCapacity: %02xh",
    b1, b2, b3);
  Serial.println(buf);
  Serial.println("Ready");
}

/*================================================================================
Low-Level Device Routines
The functions below perform the lowest-level interactions with the flash device.
They match the timing diagrams of the datahsheet. They are called by wrapper
functions which provide a little more feedback to the user. I made them stand-
alone functions so they can be re-used. Each function corresponds to a flash
instruction opcode.
================================================================================
*/

/*
 * See the timing diagram in section 9.2.35 of the
 * data sheet, "Read JEDEC ID (9Fh)".
 */
void _get_jedec_id(byte *b1, byte *b2, byte *b3) {
  digitalWrite(SS, HIGH);
  digitalWrite(SS, LOW);
  SPI.transfer(WB_JEDEC_ID);
  *b1 = SPI.transfer(0); // manufacturer id
  *b2 = SPI.transfer(0); // memory type
  *b3 = SPI.transfer(0); // capacity
  digitalWrite(SS, HIGH);
  not_busy();


/*
 * not_busy() polls the status bit of the device until it
 * completes the current operation. Most operations finish
 * in a few hundred microseconds or less, but chip erase
 * may take 500+ms. Finish all operations with this poll.
 *
 * See section 9.2.8 of the datasheet
 */
 
void not_busy(void) {
  digitalWrite(SS, HIGH); 
  digitalWrite(SS, LOW);
  SPI.transfer(WB_READ_STATUS_REG_1);       
  while (SPI.transfer(0) & 1) {};
  digitalWrite(SS, HIGH); 
}

void setup(void) {
  SPI.begin();
  SPI.setDataMode(0);
  SPI.setBitOrder(MSBFIRST);
  Serial.begin(9600);
  Serial.println("");
  Serial.println("Ready");
  get_jedec_id();
   
}

/*
 * loop() dispatches the commands compiled by the serialEvent
 * parser callback. Some commands take multiple arguments, so
 * I have to split up the strings with some messy manipulation.
 */
void loop(void) {

}

Title: Re: WT588D-16P Sound Module Working Code
Post by: smanettone on Dec 29, 2015, 07:15 pm
Try running this sketch and check the output of get_jedec_id in serial monitor:
Here you are the results:

Ready
command: get_jedec_id
Manufacturer ID: c2h
Memory Type: 20h
Capacity: 16h
Ready

I assume that i connected everything fine, but why i get "0" as capacity in the uploading sketch?  :'(
Title: Re: WT588D-16P Sound Module Working Code
Post by: purgedsoul on Dec 30, 2015, 11:28 am
Here you are the results:

Ready
command: get_jedec_id
Manufacturer ID: c2h
Memory Type: 20h
Capacity: 16h
Ready

I assume that i connected everything fine, but why i get "0" as capacity in the uploading sketch?  :'(
By the way what type of WT588D module are you using. What is the flash memory capacity is it already the USB version or the 20 pins version?
Title: Re: WT588D-16P Sound Module Working Code
Post by: smanettone on Dec 30, 2015, 12:16 pm
By the way what type of WT588D module are you using. What is the flash memory capacity is it already the USB version or the 20 pins version?
The version is the WT588D-20SS.
Title: Re: WT588D-16P Sound Module Working Code
Post by: purgedsoul on Jan 02, 2016, 05:24 pm
The version is the WT588D-20SS.
If you are already using the USB version, you can just plug your WT to the computer and upload voice files using the WT Programmer application.

If your WT is non USB you can try this:

Modify the Adafruit_TinyFlash library by opening the Adafruit_TinyFlash.cpp file and then locate this line:

Code: [Select]
return ((manID == 0xC2) && (devID == 0x13)) ? CHIP_BYTES : 0L;

change devID to 0x20:

Code: [Select]
return ((manID == 0xC2) && (devID == 0x20)) ? CHIP_BYTES : 0L;
Title: Re: WT588D-16P Sound Module Working Code
Post by: katonafull on Jan 16, 2016, 07:42 pm
If I understand correctly i have to make a bin file with the software than I have to upload that to the WT588D-16P module.
Could somebody make a schematic about arduino and the WT588D-16P module for the data upload?

I saw the page about the SPI Flash Memory
INstructable link (http://www.instructables.com/id/How-to-Design-with-Discrete-SPI-Flash-Memory/)

And I saw the schematic
(http://cdn.instructables.com/FQ2/1ISF/I3H4PGG6/FQ21ISFI3H4PGG6.LARGE.jpg)

But the pins of the Flash memory aren't same like the pins of the WT588D-16P module.

The flash memori use 3.3V, But the module maybe 5V

Here is the datasheet of the WT588D-16P module:
DAtasheet (http://DAtasheet)
Here is the datasheet of the SPI flash memory:
DAtasheet (https://www.adafruit.com/datasheets/W25Q80BV.pdf)

There are two pins on the Flash.... Pin3 (WP) and Pin7 (HOLD) on the flash memory
But what are thees on the WT588D-16P module?

Flash Memory-----------------WT588D-16P
Pin1_CS__________________Pin9_P15_CS
Pin2_DO__________________Pin6_P13_DO
Pin3_WP__________________? ? ? ? ?
Pin4_GND_________________Pin8_GND
Pin5_DI__________________Pin5_P14_DI
Pin6_CLK_________________Pin7_P16_CLK
Pin7_HOLD________________? ? ? ? ?
Pin8_VCC (3.3V)___________Pin14_VCC (5V)

So they are not same. I think the WT588D-16P module don't need the resistors too, until the flash memory need resistors in this schematic.

But i am beginner in that.
So could somebody help me?

Thanx!
Title: Re: WT588D-16P Sound Module Working Code
Post by: purgedsoul on Jan 21, 2016, 07:04 am
If I understand correctly i have to make a bin file with the software than I have to upload that to the WT588D-16P module.
Could somebody make a schematic about arduino and the WT588D-16P module for the data upload?

I saw the page about the SPI Flash Memory
INstructable link (http://www.instructables.com/id/How-to-Design-with-Discrete-SPI-Flash-Memory/)

And I saw the schematic
(http://cdn.instructables.com/FQ2/1ISF/I3H4PGG6/FQ21ISFI3H4PGG6.LARGE.jpg)

But the pins of the Flash memory aren't same like the pins of the WT588D-16P module.

The flash memori use 3.3V, But the module maybe 5V

Here is the datasheet of the WT588D-16P module:
DAtasheet (http://DAtasheet)
Here is the datasheet of the SPI flash memory:
DAtasheet (https://www.adafruit.com/datasheets/W25Q80BV.pdf)

There are two pins on the Flash.... Pin3 (WP) and Pin7 (HOLD) on the flash memory
But what are thees on the WT588D-16P module?

Flash Memory-----------------WT588D-16P
Pin1_CS__________________Pin9_P15_CS
Pin2_DO__________________Pin6_P13_DO
Pin3_WP__________________? ? ? ? ?
Pin4_GND_________________Pin8_GND
Pin5_DI__________________Pin5_P14_DI
Pin6_CLK_________________Pin7_P16_CLK
Pin7_HOLD________________? ? ? ? ?
Pin8_VCC (3.3V)___________Pin14_VCC (5V)

So they are not same. I think the WT588D-16P module don't need the resistors too, until the flash memory need resistors in this schematic.

But i am beginner in that.
So could somebody help me?

Thanx!
Hi this is how I connect them:

Flash Memory-----------------WT588D-16P
Pin1_CS__________________Pin9_P15_CS
Pin2_DO__________________Pin6_P13_DO
Pin3_WP__________________NC
Pin4_GND_________________Pin8_GND
Pin5_DI___________________Pin5_P14_DI
Pin6_CLK_________________Pin7_P16_CLK
Pin7_HOLD________________NC
Pin8_VCC (3.3V)___________Pin14_VCC (3.3V) connect it to 3.3 volts not 5

NC is no connection or not connected.
Title: Re: WT588D-16P Sound Module Working Code
Post by: katonafull on Jan 22, 2016, 10:29 pm
Thank you very much!
Title: Re: WT588D-16P Sound Module Working Code
Post by: katonafull on Jan 23, 2016, 05:37 pm
I have an arduino Uno
I made a schematic about the uploading.
Is it correct?
http://goo.gl/OGoMDh?gdriveurl (http://goo.gl/OGoMDh?gdriveurl)
(http://goo.gl/OGoMDh?gdriveurl)
Title: Re: WT588D-16P Sound Module Working Code
Post by: purgedsoul on Jan 29, 2016, 07:01 am
please see attached image for the modification. You need to supply 3.3V to your level shifter and WT. Connect the 3.3 V from the Uno to the LV pin of the level shifter and the VCC pin on the WT588D.
Title: Re: WT588D-16P Sound Module Working Code
Post by: katonafull on Jan 30, 2016, 10:21 pm
Thank you!

You are the King!
Title: Re: WT588D-16P Sound Module Working Code
Post by: destructables on Feb 23, 2016, 10:09 pm
please see attached image for the modification. You need to supply 3.3V to your level shifter and WT. Connect the 3.3 V from the Uno to the LV pin of the level shifter and the VCC pin on the WT588D.
Hey man, so... I've only got 3 SPI pins on my Pro Micro. I know my Pro Micro and wt588D are both 3.3v/5v compatible. How would I wire up between the two of them?
Title: Re: WT588D-16P Sound Module Working Code
Post by: thunderace69 on Jun 13, 2016, 02:46 pm
Hi Board, thanks for this info but im really a dumb a$$ and really lost trying to get my sound bin file onto my WT588D 16P using my Arduino Nano, can some that has managed to get it to work do an Instructable  or step by step guide with full diagrams etc. Really sorry in advance for being suck a dumb A$$. TIA
Title: Re: WT588D-16P Sound Module Working Code
Post by: thunderace69 on Jun 15, 2016, 11:02 am
Hi Again, please can someone help. I get

HELLO
0 - I assume its saying 0 bytes

My chip details

Ready
command: get_jedec_id
Manufacturer ID: c2h
Memory Type: 20h
Capacity: 14h
Ready


I changed

return ((manID == 0xC2) && (devID == 0x13)) ? CHIP_BYTES : 0L;

to

return ((manID == 0xC2) && (devID == 0x20)) ? CHIP_BYTES : 0L;

but its still not working
Title: Re: WT588D-16P Sound Module Working Code
Post by: jbkuma on Jun 21, 2016, 09:46 pm
I keep getting the error "Could not find connected Arduino running WT588DAudioLoader sketch." when I run the processing sketch.  I've tried a number of different things, but I can't seem to get it to connect. 

I'm running a pro mini 3.3v. When I open up the serial monitor I get the appropriate Hello message.  Do you think it could be my FTDI adapter?
Title: Re: WT588D-16P Sound Module Working Code
Post by: Anghelos on Sep 14, 2016, 10:42 pm
I'm making experiments with the Arduino pro mini (3,3V 8Mhz Atmega328) and wt588d-16p but still cannot have the sound playing.....I feel very dumb and stupid.

What I did:
I managed to upload the following programm inside the Arduino Pro Mini:
https://github.com/tfk/WT588D

also including the library, plus I uploaded the programm using the loader with the options "one line serial mode" and setting the busy mode to low as requested by the User of this code. I also managed to upload the 'songs' (sound effects in wav)

I had some problems to put the code inside arduino, coz I had my com6 disappearing and not able to load everything at first...but finally I managed, the Arduino board works, coz I tried the 'blink' example and it works.

I connected (as the code says) the Arduino Pins: 7-9-10 to Busy, RST and SDA of the WT588D, following this image: http://i00.i.aliimg.com/img/pb/718/697/055/1055697718_357.jpg

Then I connected the VCC of the Arduino board to the VCC of the WT588D and the GND to the ground for both arduino and the WT-board.
Finally i connected the RAW of the ARduino to the + of the battery (and the Minus of the battery to the common GND)

OFC i attached the 2 PWM of the WTD to soundspeaker....but while the arduino board is showing red light, no sounds comes from the speaker.....

What the hell did i do wrong? isn't the code supposed to play the list of wav files as soon as i power it?
Title: Re: WT588D-16P Sound Module Working Code
Post by: mtibi75 on Nov 14, 2016, 07:17 pm
Hi all!

Another working code, simple onewire control:
Video: https://www.youtube.com/watch?v=h9qT3Uxnvrs (at 1:30)



void WT588D_reset() {               //OPTIONAL!
  digitalWrite(WT588D_RESET, LOW);      //reset chip 5ms
  delay(5);
  digitalWrite(WT588D_RESET, HIGH);      //min 17ms       
  delay(20);

void WT588D_data(byte data) {
  digitalWrite(WT588D_DATA, LOW);
  delay(5);                        //init data line 5ms
  for (int j = 0; j < 8; j++) {
    digitalWrite(WT588D_DATA, HIGH);
    if (bitRead(data, j)) {
      delayMicroseconds(400);         //400+LOW+200=1
      digitalWrite(WT588D_DATA, LOW);
      delayMicroseconds(200);
    } else {
      delayMicroseconds(200);         //200+LOW+400=0
      digitalWrite(WT588D_DATA, LOW);
      delayMicroseconds(400);
    }
  }
  digitalWrite(WT588D_DATA, HIGH);
}

void WT588D_speech(byte speech_number, byte volume) {
  Serial.println("Speech: " + String(speech_number) + "," + String(volume));
  WT588D_data(volume + 0xE0);
  delay(100);                     //min 90ms after volume change
  WT588D_data(speech_number); 
}
Title: Re: WT588D-16P Sound Module Working Code
Post by: beyondal on Dec 09, 2016, 06:08 pm
So if i'm correct I can buy the wt588d 16 module and upload my code via a arduino uno.

But does this module (wt588d)  have a GPIO? Let's say I want to attach a sensor and when the sensor (infrared, tilt-sensor, pressure sensor, etc..)  is triggered it plays the song. And is this programmable in the arduino platform.

I need 50 for this project, so I need to be sure I can do this with this module. (it's cheap :) )

I already have a level shifter laying around to program them.

At last, did somebody power these with a battery, if so, how was the performance for your type of battery.

Title: Re: WT588D-16P Sound Module Working Code
Post by: williamscliew on Apr 10, 2017, 05:25 am
Hai there, i have try the code but i get the message "arduino failed to initialize flash memory"

I am new to this and using arduino nano v3 connected to wt588d-16p

What happen?

Hope you could help

Thank you
Title: Re: WT588D-16P Sound Module Working Code
Post by: williamscliew on Apr 10, 2017, 09:07 am
now i got everything running fine but sound...