IMP & Parallax Emic2 Text-to-Speech Module

I have been trying to get the arduino setup from the sparkfun example work on IMP-only.
Its all powered, but doesn’t talk, yet it is just a serial connection.
Anyone any experience with this one?

Is the text to speech logic built on 5V? or what?

Based on the specs the Serial IN line expects 3.3V to 5V, so shouldn’t need a logic level converter (Serial OUT on the other hand is 5V, and should be stepped down if you’re passing it into the imp).

Can see what your code and circuit looks like? Their basic example shows an 8ohm speaker hooked directly up to SP+ and SP-

I have the same setup as they have on the arduino example. Just switch impee 5,7 with their arduino rxtx on 2,3. I put the logic converter between sOUT on the emic and port 5 on the IMP.

This is my code:

`
// Serial Communication
function readSerial()
{
local serialConn = hardware.uart57;
local readBuffer = blob(1);
local byte;
local byteIndex = 0;
local str = “”;

while((byte=serialConn.read())!=-1){
    readBuffer.writen(byte, 'b'); //Can comment if you don't want to use the blob
    server.log(format("Byte %d = %d = 0x%2X = %c", byteIndex++, byte, byte, byte)); //Can comment if you don't want individual byte logging
    str += byte.tochar(); //Converts integer read by UART into ASCII char for string representation
}
if(str.len() > 0){ //Function may get called by callback when no data is present - no need to log
    server.log("Read String Representation = " + str)
}
//server.log("Serial event:"+serialConn.read());
serialConn.write('\

'); // Send a CR in case the system is already up
serialConn.flush();
serialConn.write(“Message Received”);

}

// configure a pin pair for UART TX/RX
hardware.uart57.configure(9600, 8, PARITY_NONE, 1, NO_CTSRTS, readSerial);
imp.configure(“Text To Speech”, [], [], {});

server.log(“DEVICE started”);`

After I restart the hardware, the emic does send a single byte, which I assume should be the ‘:’, but the IMP prints out : Read String Representation = �
Which is obviously not right. Also when I write something to the emic, not a beep.

So something is still not right.

I noticed there is a different configure set up along the lines of something.en for the readserial callback.

Apart from that, everything has power, seems to run, its just a small step of software that I am missing. And I am half proud I got this to work without arduino(once its working)

Still very messy and many features missing, but the general setup works:

CODE
`
::IMP_ID <- hardware.getimpeeid();
server.log(“STARTING DEVICE:”+IMP_ID);

::SpeechReady <- 0;
::speechSerial <- hardware.uart57;

// Serial Communication with EMic2
function readSerial()
{
local serialConn = hardware.uart57;
local readBuffer = blob(1);
local byte;
local byteIndex = 0;
local str = “”;

while((byte=serialConn.read())!=-1){
    readBuffer.writen(byte, 'b'); //Can comment if you don't want to use the blob
    server.log(format("Byte %d = %d = 0x%2X = %c", byteIndex++, byte, byte, byte)); //Can comment if you don't want individual byte logging
    str += byte.tochar(); //Converts integer read by UART into ASCII char for string representation
}
if(str.len() > 0){ //Function may get called by callback when no data is present - no need to log
    server.log("Read String Representation = " + str);
}



if(SpeechReady==0)
{
    SpeechReady = 1;
    
    server.log("speak");

     serialConn.write('\

'); // Send a CR in case the system is already up
serialConn.flush();

    serialConn.write('N'); // Select voice
serialConn.write("1"); // Our voice from Beyond
serialConn.write('\

‘); // Terminate the voice command
serialConn.write(‘S’); // Select voice
serialConn.write(“I am Redddeee!”);
serialConn.write(’
’); // Terminate the voice command

server.log("SAID");
}

// wait till spoken
//while((byte=serialConn.read().tochar())!=":"){}

}`

To anyone trying this, I would recommend, setting up clean functions for speaking and voice settings, etc.
Also always wait till one text is finished and the module is ready.
Who knows, I might do a ‘class’ on this.