Connecting the SP03 Speech Module to the BS2p

Introduction
One of the methods the SP03 modules uses for communication is the I2C bus . This example shows how to connect
the SP03 to the BS2p. The SDA (data) and SCL (clock) lines are connected to
pins P8 (pin13) and P9 (pin14) on the BS2p. These are the pins used by the BS2p for the I2CIN and
I2COUT commands.
The BS2 internal 5v regulator is not suitable for powering much external
circuitry. I therefore recommend you use a separate 5v regulator.
This example requires that you are using BS2p firmware release Rev C or later.
Circuit Schematic for connecting the SP03 Speech Module to the Basic Stamp BS2p
The schematic above shows 4k7 pull-up resistors on the SCL and SDA lines to
Vdd, as recommended by Parallax.
For greater noise immunity, I recommend pulling up to the SRF08's 5v supply
instead (so as not to place any more load on the BS2) and using 1k8 resistors.
Software
The following shows how easy it is to use the BS2p with the Speech Module, a
single line command is all that is required to speak any of the 30 pre-loaded
phrases. Your own text strings of up to 80 characters in length may be sent to
the synthesizer for conversion to speech.
The sample code below can be downloaded here.
| '{$STAMP BS2p} '*********************************************************** SCL con 9 ' I2C clock status varbyte Main: gosub wait4shutup ' wait for last phrase
to finish speaking ' You can also send your own Text to Speech
messages to the module to be spoken. gosub wait4shutup ' wait for last phrase
to finish speaking ' The above loads the modules internal buffer.
You then need to send a command to i2cout SDA, $c4, 0, [$40] ' The speak command also flushes the buffer ' You can also load the buffer in smaller,
multiple fragments if you wish to. gosub wait4shutup ' wait for last phrase
to finish speaking ' And thats it. forever: goto forever wait4shutup: |
You can find more information on the SP03 here