i2c comms to speech module SP030

LongRat

New Member
Hello everyone,
first of all, this is my first post on the forum. I'm a new Picaxe user, I am a hobbyist/experimeter type person. My interests are generally RC type applications - cars and planes. I've been hanging around here for a few months, seems there is some really good knowledge here and some seriously impressive projects!

Anyway my question regards my first project. It is a 40X1 based turbo boost gauge that reads pressure from a MAP sensor and outputs the value to an LCD, also a 13 element array of LEDs and reports various things to the speech module. This is a simple problem so it's a bit annoying to have to ask, but... I can't seem to get the SP030 to speak the value in a variable - only the variable name or ASCII character that maps onto the value of the variable (i.e. 65 = "A"). What am I doing wrong?

Code:
main:
	symbol boostunit = b0
	symbol boosttenth = b1
	
	boosttenth = 65
		
	i2cslave $c4,i2cfast,i2cbyte
	writei2c 0,(0,2,5,3,boosttenth,0)

	writei2c 0,(64)
Thanks :eek:
 

eclectic

Moderator
Welcome to the Forum.

I don't own the Speech module, so,
I can't speak from knowledge.

However, as a guess,
perhaps break up the value
into two digits, then play from there?

Code:
main:
	symbol boostunit = b0
	symbol boosttenth = b1	
	boosttenth = 65		
	i2cslave $c4,i2cfast,i2cbyte
	writei2c 0,(0,2,5,3,boosttenth,0)
	writei2c 0,(64)	

;additions?  ****
	
	b2 = b1/ 10   ;6
	b3 = b1//10   ;5
	
	b2 = b2 + 48
	b3 = b3 + 48
	
	sertxd (b2,"  ",b3) ;simulation test
	
;	then write b2, then write b3.
e
 
Last edited:

westaust55

Moderator
speech module SP030

have not used my SPE030 for a while but it is primarily a text to speech synthesis unit.
I did a lot of programming including own text to speech synthesis with an SC01 chip long ago (around 1980).

Recall the SPE030 will say an individual digit eg: 6 is said as "six"

so think your program needs to convert the numbers to words. A look up table with words like teen, twenty, thirty, forty, . . .hundred, and, thousand . . . etc.

This is something I was going to get around to myself but too many other things also in the pipeline of recent.

then your program breaks the numbers down to words.
you will also find that at time it is better to try some different spellings to get a better pronunciation.

eg PICAXE could be: pick acks
hello might be: hel low

a case of playing with alternative word spellings that sound phonetically similar.

You will find a past post on this forum where I also added a couple of components to improve the volume a bit. there is a limit before the onboard amp IC starts to distort appreciably.
 
Last edited:

LongRat

New Member
Thanks for your replies guys. Look up table it is then!
I've done a bit of experimenting with the pronunciation and to be honest I'm pretty impressed. Absolutely incredible that it does all that on a single chip.
 

BeanieBots

Moderator
Been a few years since I played with one either but I'm quite sure it 'speak' long numbers. However, the numbers need to be in ASCII.
Try sending it "6" rather than a simple 6.
If you are using serial comms, then use the # operator.
If you are using I2C, then use bintoascii.
Alternatively, add $30 to each digit before sending.
 

LongRat

New Member
BB, I didn't know about bintoascii - sorted it, thanks!
Now I've got another problem though. The SP030 manual says you can charge the speak buffer a number of times before you call a speak command, thus building up a phrase. I'm finding this not to be the case! Every time I do this it only ever speaks what I told it in the first load buffer command:

Code:
	writei2c 0,(0,2,5,3, "Maximum",0)
	bintoascii boostunit, asciiboosthundreds, asciiboosttens, asciiboostunits
	writei2c 0,(0,2,5,3, asciiboostunits,0)
	writei2c 0,(0,2,5,3, "point",0)
	bintoascii boosttenth, asciiboosthundreds, asciiboosttens, asciiboostunits
	writei2c 0,(0,2,5,3, asciiboostunits,0)
	writei2c 0,(0,2,5,3, "bar",0)
	writei2c 0,(64)
In this case, it just says "Maximum". Is the data sheet wrong or am I doing something wrong?
 

BeanieBots

Moderator
Glad you got that bit sorted.
I don't remember ever trying to load the buffer in several hits and then speak but I did pre-load phrases ready to speak and then call them on demand.
It MIGHT be that you asking to speak after buffer load.
If get a mo, I'll dig out my SPE03 and have another play.
 

Technical

Technical Support
Staff member
The final 0 terminates the string - so you only need one right at the end. You need spaces between words as well!

Code:
    writei2c 0,(0,2,5,3, "Maximum ")
    bintoascii boostunit, asciiboosthundreds, asciiboosttens, asciiboostunits
    writei2c 0,(0,asciiboostunits)
    writei2c 0,(0," point ")
    bintoascii boosttenth, asciiboosthundreds, asciiboosttens, asciiboostunits
    writei2c 0,(0,asciiboostunits)
    writei2c 0,(0," bar",0)
    writei2c 0,(64)
 
Last edited:

LongRat

New Member
Technical - that's beautiful! Works perfectly now. Thanks for everyone's help - I'll post a project thread in the appropriate area when I've built all the hardware. Really enjoying using the Picaxe.
 
Top