Shop OBEX P1 Docs P2 Docs Learn Events
Emic 2 and Parallax Terminal — Parallax Forums

Emic 2 and Parallax Terminal

elder1943elder1943 Posts: 8
edited 2012-07-28 21:24 in General Discussion
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

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-07-24 20:25
    Are you adding the ":" to the beginning of your commands? If so don't. I made this mistake myself. The ":" is the reply from the Emic 2 not part of the command.

    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).
  • elder1943elder1943 Posts: 8
    edited 2012-07-24 20:45
    The Emic 2 bd does not talk to the terminal program. As I understand it the Emic 2 bd will send a ":" and then waits. The LED on the Emic 2 bd is green so I am guessing it is waiting. I have tried typing a few commands Nx, C etc and nothing apears to work!
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-07-25 01:18
    Hi, welcome to the forums!

    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!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-07-25 02:08
    Here's a really basic program to use with the Emic 2.

    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.
    Pst[EMIC_COM].Str(string("V-36", 13))
      Pst[EMIC_COM].CharIn
      Pst[DEBUG_COM].Str(string(13, "Volume Low"))
    

    Otherwise the sound will be very very soft.

    Sorry, but I didn't want to upload a corrected version.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2012-07-25 05:29
    I wanted to be able to experiment with the Emic 2 without repeatedly loading microcontroller code, so I used the Parallax USB2SER adpater and wrote an HTML Application (.hta) which lets me send text files to the Emic 2 and also let's me edit, Load and Save them.

    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...

    attachment.php?attachmentid=94450

    Emic2 util.jpg
    958 x 555 - 90K
  • elder1943elder1943 Posts: 8
    edited 2012-07-25 05:29
    First a big loud thanks to all here for the offered thoughts and ideas. My "physical connects" are correct. Reading the source code for the demo program it requires a baud rate of 115.9. I set the terminal to 115.9k and the Emic 2 demo talks to the terminal fine. The terninal sees "hello" etc as the demo runs. I am using the standard lib. objects Full Duplex Serial down load from the listing for the Emic 2 software on the catalog page. I will try Duane's software as soon as I have my coffee!
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-07-25 05:41
    elder1943 wrote: »
    I will try Duane's software as soon as I have my coffee!

    You may be a newcomer to the hobby but your life experiences will serve you well. ALWAYS - coffee first! :lol:

    @Ron, your test utility looks very useful! Well done!
  • ercoerco Posts: 20,259
    edited 2012-07-25 08:54
    NICE terminal, Ron! We're tracking closely on projects. Here's my poor man's version for the 512: http://www.youtube.com/watch?v=UhhDEhzF3PM
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2012-07-25 13:57
    I tweaked my utility to handle text strings that are too long for the Emic 2 buffer (like the Star Spangled Banner example).
    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
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-07-25 15:54
    There is a delay between the lines, but I edited it out in this mp3.

    Ron, What about using the ":" reply as a type of flow control? Or is this what causes the delay?
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2012-07-25 17:19
    Duane Degn wrote: »
    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]).
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-07-25 19:36
    I ended up using the ":" as a form of synchronization on my talking dancing 4-h robot. I ended up with 3 routine Say, SayAndWait and WaitForEMIC.

    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!
  • elder1943elder1943 Posts: 8
    edited 2012-07-27 14:20
    Problem solved.....It turned out that the files were not correctly loaded in the bench computer ! A big tip of the hat and thanks to all who responded!!!!!! This calls for another cup of coffee !!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-07-27 16:44
    Jim,

    How's it going with the Emic 2? Is it jabbering away?

    Duane
  • elder1943elder1943 Posts: 8
    edited 2012-07-28 21:24
    The Emic 2 board is speaking/working fine. I am playing with the code trying to learn to speak Propeller. The demo works as designed as well as other code I have downloaded.

    Jim
Sign In or Register to comment.