Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Speakjet Project

Status
Not open for further replies.

dpayne

New Member
Greetings everyone. I come to you with a question about something I know nothing about. PIC programming. Im not looking for someone to write a program for me, this is actually something i would love to learn, i just need a push in the right direction.

The project is actually just a little light sensing robot that Ive made for my son. However what I would like to do is using the speakjet chip and the TTS256 text to speech chip, make this little robot talk. I would like for the robot to say phrases at random by have the phrases the robot says randomly selected by using a PIC with a/d conversion.

So basically how do i do that?

I would assume I can use some kinda of sensor sending an analog signal to a PIC. The PIC would then convert that signal to a range (something like 1-100). And then that result would play a phrase associated to that number. Say for instance I was using some kinda if microphone.

Microphone takes a reading of 2db, PIC A/D converts that to a 4, Phrase 4 is "Hello there".

Something along those lines. Any help would be greatly appreciated. Any links and general instructions on what to look into would be great.

David
 
So basically how do i do that?
Since the TTS256 accepts data at 9600 N81 baud over a non-inverted TTL level serial interface, you can simply connect it to the PIC pins which host the USART interface. You could store your select phrases in the PICs ROM or eeprom memory. Then you simply send the appropriate ASCII string to the TTS256 as needed.
Microphone takes a reading of 2db, PIC A/D converts that to a 4, Phrase 4 is "Hello there".
That would give you very random phrases. You probably want something more sophisticated. You could connect your light sensor to the ADC and when the PIC senses that the light level has varied up and down rapidly, it could utter, "Who's there?" Or if its very dark, it could randomly utter, "I'm not afraid of the dark." If, within a 15 seconds of this, the light suddenly increases, probably because you turned the lights on, it could say, "Hey! I can see now. Thank you!"
You could also add microphones for extra stimuli. All you could do with that is have it respond with, "I thought I heard something." I wouldn't try to implement any type of speech recognition as that would take too much effort for a project which should be kept relatively simple.
 
Last edited:
Thanks for the fast response.

So the basics I need to learn is how to store ascii strings to the PIC's ROM. And then how to call those strings based on the input.

Im hoping this is something I can figure out with enough tutorials or looking at other peoples code.
 
Last edited:
How you store/access the strings depends on the programming language you use. Are you going to use Basic, C, or ASM?
Start with very simple code. ie: Write a routine that sends one character/byte at a time out the USART. Then simply send the ASCII for 1 (0x31), delay at bit, and then send an ASCII line feed (0x0A) and, if all is working right, you'll hear it say, "one".
After that bit of inspiration, look at storing complete phrases in ROM and rewriting the routine to send the entire string in sequence.
Only after that is all debugged and working, should you proceed with the rest of the coding for stimulus decoding etc.
ie: Make it modular and do it one small step at a time.
 
My plan was to use Basic as i was told its the easiest for a beginner to learn.

Im definitely going to have to get some books or try and find some sample code because even with your help and explanation im still not really grasphing how I would start this. I do appreciate your help though.
 
Start with very simple code. ie: Write a routine that sends one character/byte at a time out the USART. Then simply send the ASCII for 1 (0x31), delay at bit, and then send an ASCII line feed (0x0A) and, if all is working right, you'll hear it say, "one".
Can it actually pronounce words from written text? I may have missed a section, but it looks like it pronounces allophones (so you have to break up the words into allophones first before sending the appropriate code/index). I did notice you can make it say "Ready" by sending '\0', 'V', '\a' though.
 
The speakjet itself only produces allophones and some sound effects. However the TTS256 is a ASCII to Allophone converter if you will.

So you program a pic to send text to the TTS256, then TTS256 converts your text to allophones, and sends that to the speakjet.
 
My plan was to use Basic as i was told its the easiest for a beginner to learn.
It depends on what you want to do. Though I haven't used it, many here use the Swordfish basic compiler with the 18F series PICs.
Im definitely going to have to get some books or try and find some sample code because even with your help and explanation im still not really grasphing how I would start this. I do appreciate your help though.
If you haven't programmed with PICs before, then you must first pay tribute to the god of PIC LED FLASHING! Much will be revealed to you on the LED flashing journey, which will help you with your future quest. ;)
 
Have a look at the TalkBotBrain, it will store your sounds direct from Windows using the free windows software (so you don't need to program it) and you can ask them to supply it pre-programmed with a random sound play firmware. That only needs a single button press (or TTL signal wire) and each time it will play a different random sound from any of the sounds (up to 255 sounds);
Official homepage of TalkBotBrain.com
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top