Emic 2 and Parallax Terminal
elder1943
Posts: 8
I have just received the Emic 2 bd and have it connected to a prop chip P6 P7. The Emic 2 Demo loads and plays fine. I have the Parallax Serial Term. software loaded in my bench computer. com 3, 9600 baud. I loaded the serial software in the prop but I cannot get the prop/Emic 2 to talk to the terminal program. I never get the ":". All suggestions are welcome. I am a "new commer" to the Prop. chip/Emic 2/parallax Terminal software so it is most likely something I am missing!
Comments
I'll find and post my demo Emic 2 code in a few minutes.
Edit: I just found my Emic 2 code. It's a mess. I'll post it if you like but I'm betting you had a leading ":" on your commands. Once you remove it your program should work.
If you still need a demo program let us know and if no one else posts something I'll post my code (it doesn't use PST, it uses a four port serial driver).
It would really help if you could post your code that is running on the propeller. Please place it between [ CODE ] [ /CODE ] tags (remove the spaces from inside the two tags to make them work. If you are using standard library objects such a Parallax Serial Terminal and Full Duplex Serial, you don't need to post those.
Since the demo program runs, it seems your Emic2 and Propeller are connected together correctly. This would point to some problems in your code. I haven't written a program to interactively talk to the Emic2 , all my uses have been sending canned text from my Spin program to the Emic. My guess is that you aren't passing the data you read from the serial terminal to the Emic correctly.
The pieces all work, so we can help getting them to work TOGETHER for you!
You'll want to change the I/O pins and debug baud to match your setup.
It will send to the Emic 2 whatever is typed into the terminal window followed by return.
It's kind of tough to use Parallax Serial Terminal.spin with the Emic 2 since the "checkrx" method isn't public. I think I have the correct number of "CharIn" calls to read the ":" returned by the Emic 2.
I agree with Rick about posting your code. The example I just posted is very limited.
I just remembered. I left in the command to turn the volume way down. (I didn't want to disturb my wife.). You'll want to comment out these lines.
Otherwise the sound will be very very soft.
Sorry, but I didn't want to upload a corrected version.
It employs a DLL I created VB6 to enumerate the active COM ports so they can be chosen via a dropdown box.
Saves time an EPROM cycles on the Propeller/BS2...
You may be a newcomer to the hobby but your life experiences will serve you well. ALWAYS - coffee first!
@Ron, your test utility looks very useful! Well done!
There is a delay between the lines, but I edited it out in this mp3.
A female voice rendition of the Star Spangled Banner by Emic 2
Listen http://ronczap.home.insightbb.com/StarSpangle.htm
Ron, What about using the ":" reply as a type of flow control? Or is this what causes the delay?
HTA routines can't be directly triggered by events like in a .vbs files (e.g. from the COMM object), but by using a windows.setTimeout instruction, you can check for responses frequently (I am checking every 200ms).
I check for the Emic 2 ":" response but it seems there is a delay in the Emic - maybe when the voice is restored at the end of each segment (e.g. [:n0]).
Say just passed the string to EMIC and returned control to the caller. The main program would continue with movement and when done it called WaitForEMIC which is just a repeat loop waiting for the ":" to come in off the serial port.
SayAndWait combined the two routines above and passed the string to EMIC and then went into a repeat loop immediately waiting for the ":"
There does appear to be a pause from when you send the string until speech starts. I assume this is the time needed to parse the string internally and convert it to phonemes.
The appearance of the ":" on the serial line seemed to track accurately with the completion of speaking.
I did a bunch of quick and dirty code to get this working so I really don't have a library to share. If time permits, I could see being able to queue up speech strings and just let it chatter away if needed.
It certainly is fun to play with and has a lot of potential uses.
I'll post my code if anybody is interested. It's not pretty but it worked!
How's it going with the Emic 2? Is it jabbering away?
Duane
Jim