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}

'***********************************************************
'**                                                       **
'**         I2C Routines for the Basic Stamp BS2p         **
'**          Controlling SP03 Speech Synthesizer          **
'**                                                       **
'**             Copyright 2002 - Devantech Ltd            **
'**     Commercial use of this software is prohibited     **
'**     Private and educational use only is permitted     **
'**                                                       **
'**        Written by Gerald Coe - August 2002            **
'**                                                       **
'***********************************************************

SCL   con 9 ' I2C clock
SDA   con 8 ' I2C data
NOP   con 0 ' No Operation command

status varbyte

Main:
' 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. The example below shows how to speak phrase number 21.

  gosub wait4shutup ' wait for last phrase to finish speaking
  i2cout SDA, $c4, 0, [21] ' speak phrase number 21 and flush internal buffer

' You can also send your own Text to Speech messages to the module to be spoken.
' The first data byte is the command, in this case a NOP, since we just need to 
' load the buffer. The 2nd value is Volume (0-7) which works backwards - 0 is 
' loudest and 7 is quiet. The 3rd value is Pitch (0-7) which it is best to just
' try it and see. The 4th value is Speed (0-3) with 3 being fastest.
' You then place the text you wish spoken in inverted comma's and finally
' the 0 (NULL).

  gosub wait4shutup ' wait for last phrase to finish speaking
  i2cout SDA, $c4, 0, [NOP, 0,5,3, "Hello Gerry, How are u today", 0]

' The above loads the modules internal buffer. You then need to send a command to 
' speak the phrase you just loaded.

  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.
' Up to 85 bytes can be stored in the SP03's internal buffer, that's 81 characters
' plus the Volume, Pitch, Speed and terminating NULL.

  gosub wait4shutup ' wait for last phrase to finish speaking
  i2cout SDA, $c4, 0, [NOP, 0,5,3, "This is a test on how"]
  i2cout SDA, $c4, 0, [NOP, " to send a message as"]
  i2cout SDA, $c4, 0, [NOP, " a number of smaller pieces", 0]
  i2cout SDA, $c4, 0, [$40] ' Speak the phrase.

' And thats it.
' The following completes the program so that you can run it.

forever: goto forever

wait4shutup:
  i2cin SDA, $c4, 0, [status]
  if status>0 then wait4shutup
  return
 

You can find more information on the SP03 here