12C509 PIC for SPO256 PCB


Why PIC  //  PIC Code  //  Schematic  //  Circuits

12C509 PIC for Controlling the SPO256 PCB


Why use a PIC on the Speech PCB?

The SPO256 doesn't have any RAM or storage for the allophone sequence. [It does have all of it's allophones in ROM and an allophone buffer for one.] It processes a single allophone at a time. So "something" has to hold it's hand and busy-wait until it's ready for the next allophone. The allophones are 50-300 milliseconds long so the controller can do lots of other things in between checking the SPO, so it is possible for the controller to do other things while it is speaking. However, it does become increasingly more difficult to add new behavior.

That's why I put a socket on the circuit board for a 12C509 PIC. It has 41 bytes of RAM of which 32 could easily be used as a circular buffer [not a lot, but probably enough] to queue up a phrase. My plan is to let the microcontroller blast down up to 32 allophones to the PIC and then do what else it needs to do. The PIC can twiddle the lines to hold the SPO's hands and the microcontroller can check back with the PIC at a greatly reduced frequency. (schematic)


12C509 Code

I have not finished writing the code for the PIC but it is coming along nicely (see also the allophone include file). If you're bored, can read/write PIC assembly, and want to help me debug, let me know!

I have recently discovered the virtues of the I2C bus... I'm thinking of making a version of the PIC to interface the SPO chip. It depends on how much space the code takes [or reduces!].

Note: With very minor modification, this code would allow a 12C508 to be used. The circular buffer would only be 16 bytes [no code change required!] and there would be far fewer stock phrases possible. But for the very trivial price difference, just use the 12C509!

Some features:
  • Serial input at 2400 baud [possibly 9600]
  • Only uses two I/O lines for complete control [reducible to 1 with some rewiring].
  • Ready line goes HIGH when buffer is full.
  • Stock phrases [numbers, robot-speak, common phrases, etc.] Probably max of 64.
  • 32 byte buffer of allophones or stock phrases
  • Some board control: [codes subject to change]

    CodeCommandComment
    0CancelStop speaking stock phrase
    1Clear Buffer Empty circular buffer [should pause first]
    2External CIAL CIAL lines to be controlled Externally
    3Internal CIAL CIAL lines to be controlled by the PIC
    4PausePause speaking but accept input bytes
    5Un-pauseResume speaking
    6Stop Stop speaking allophone
    7SleepPut PIC to sleep - power-save mode
    Wakes on Input pin change.

    More details coming...


    12C509 Schematic

    12C509 WRONG Schematic 12C509 Corrected  Schematic
    NOTE: I found another error on the PCB. It is not fatal. The Input line of the PIC would be pulled-up if you soldered in R9. This is shown on the schematic on the left - it is wrong!

    NOTE: This is fixed on later versions of the PCB.
    My original idea was to make Input behave like input/output pin by pulling it up (or down) according to the Ready line. Thus, the controlling circuit need only check the input line when it is not driving it [low or high] to see if the board can take any more allophone bytes.

    You'll need to rewire this area slightly if you want to go this route. See schematic on the right!
    If you will not use the PIC or want to use two lines for control, don't solder in R9.


    SPO Circuit:

    NOTE: The following circuit schematics originally came from Jon Williams' article "Using the SPO256-AL2 Speech Allophone Processor" in the June 1998 issue of Nuts and Volts [Volume 40]. Go to the Paralax site, Downloads, Nuts and Volts columns for more useful stuff!
    Note: I originally found the gif of this circuit at TheOneSpot - Robotics - Text 2 Speech but that link appears to be broken. :-(

    SPO Circuit


    Note that the output pins QA-QH from the shift register [74HC164] are swapped MSB for LSB going to the SPO256 chip. This greatly reduced the difficulty of the trace routing for the nested shift register [which was nested to conserve board space].

    Audio Amp circuit:

    Audio Amp


    Original audio circuit gif.



    This page made of 100% recycled bits.
    Edited (as my 12-year son brags of his web pages) with Notepad.