Shop OBEX P1 Docs P2 Docs Learn Events
Interfacing the SpeakJet... HELP! — Parallax Forums

Interfacing the SpeakJet... HELP!

mikeweezermikeweezer Posts: 27
edited 2004-11-19 16:50 in BASIC Stamp
Hi everyone.

I must say I am extremely happy to see Parallax has created this forum. I have an issue I need to get solved ASAP, so I need your help! I recently purchased 2 speakJet chips voice synthesizers. What I am trying to do is to run text through the RS232 port on the Stamp and out through the chip for it to speak out what I am writing. I don't have the accompanying board, but Parallax has led me to believe it can be done without it. From my understanding, it has to do with converting RS232 signals to TTL signals? I have the SpeakJet wiring correct, the demo mode and speaker works fine. Any schematics, coding, or general suggestions would be excellent. THANK YOU!!!

Mike
mwweisert@yahoo.com

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-16 12:45
    Do I understand that you're trying to control the SpeakJet using the BASIC Stamp's programming port?· To be honest, I don't know if this will work because the inverter circuitry on that port is counting on RS-232 levels from the other side.

    If you're making a direct connection you can use any of the BASIC Stamp's IO pins.· I've attached some demo code that should help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • mikeweezermikeweezer Posts: 27
    edited 2004-11-17 00:35
    Thanks for your quick reply. Let me be a bit more specific...

    I have placed the SpeakJet onto the prototyping board attached to the board of education. I have lines for power, ground, in and out going from the stamps VDD, VSS, p15, p14, respectively. The text that I would like the speakjet to "speak" is coming from a computer running a python script that feeds the stamp text through the Serial Cable. So in essence, the stamp is constantly recieveing new things to "say" from a PC that will be always hooked into the serial port. So I need to know how to send a signal from a pin on the stamp, into the TTL line of SpeakJet so it can understand it. I should also add that my programming and electronics capabilities can best be described as "moderate", so if anyone can explain it to me like I am an idiot (which I am!) that would great! Thanks for all your help....


    Mike
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-17 01:01
    You may not be able to do what you're wanting to do -- the BASIC Stamp doesn't have a serial buffer and unless you're sending a fixed-length packet, you will have problems.· I suppose another option is to send the bytes from your script, one at a time, at a very slow rate so that you can receive one in, then send it out.· I don't think the SJ will care about the pacing between characters.· If you want to give that a try, this should get you started:


    Main:
      DO
        SERIN  16, $4054, [noparse][[/noparse]sjByte]                        ' get byte from PC
        SEROUT 15, 84, [noparse][[/noparse]sjByte]                           ' retransmit to SpeakJet
        IF (IN14 = 1) THEN                                ' if buffer full, stop sending
     
          ' tell PC to stop transmitting
     
          DO : LOOP UNTIL (IN14 = 0)                      ' wait until buffer clears    
          
          ' tesll PC to start transmitting again
          ' after a brief pause so SERIN can be ready
     
        ENDIF
      LOOP
    


    You'll have to use software flow control with your script.· When the BASIC Stamp detects the buffer full pin, it will have to send a message to the PC telling it to stop sending characters.· After the buffer clears the BASIC Stamp can tell the script that it's okay to start sending again.· Just make sure that the PC pauses a bit before it starts resending so that SERIN can load up and be ready for the character.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • mikeweezermikeweezer Posts: 27
    edited 2004-11-17 01:04
    Thanks Jon, I'll give that a try later tonight and let you know how it works out...
  • KenLemKenLem Posts: 94
    edited 2004-11-18 21:47
    Hi,

    I think the SpeakJet will care about spacing between characters. It tries to smooth between phonemes when it can and also lowers the volume on a sound when it thinks it is a the last one in a sequence. You might have to be careful about just how slowly you feed the SpeakJet otherwise you'll get some odd results.

    Ken
    www.speechchips.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-19 02:29
    My memory is different, but I gave up on the SpeakJet quite a long time ago so I could be wrong. I was under the impression that the SJ waits for the EOS byte ($FF) before processing the phonemes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • mikeweezermikeweezer Posts: 27
    edited 2004-11-19 08:42
    Hi all,

    I have the speakjet working with one of the codes I found on their website. I am currently working on using Python's serout commands to send text to it for speach processing. They are communicating, just a minor issue with it letting me send all 3 digits of the code for processing. Note: SpeakJet will process each word individually, and does wait for an EOS command at the end of each word. In the demo it does "Parallax Basic Stamp" At the end of the allophone sequence, it does function better with an EOS. I'll let you guys know how it comes out. Thank you all for your help, wish me luck!

    Mike
  • KenLemKenLem Posts: 94
    edited 2004-11-19 16:50
    Jon,

    I wrote something to step through all of the phonemes on the SpeakJet and save them to .wav files. I was considering doing a SpeakJet emulator/Text to speech converter similar to my ChipTalk program for the SP0256-AL2.

    As I recall, I sent a single phoneme then waited a certain period of time so that they would not blend together. The SpeakJet was decreasing the volume towards the end of each sound as it thought it was at the end of a sentence. I'll check my code to see if I was sending and EOS after every phoneme. You're probably right.


    Ken
    www.speechchips.com
Sign In or Register to comment.