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).
Actually, I have coded everything that I planned on doing, including a large number of internal messages, or 'stock phrases' using up ALL of the chips program memory.
But the timing for the communications is broken and I can't seem to debug it.
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.


    Stock Phrases

    These are some phrases I thought might be commonly used, so they can be spoken by one command code. Many of them are actually chained together.
    IDPhraseComment
    0zeroNumbers to 0 to 20 are the same ID.
    1oneditto
    2two, to, tooditto
    3threeditto
    4four, for, foreditto
    5fiveditto
    6sixditto
    7sevenditto
    8eight, ateditto
    9nine, Neinditto
    10tenditto
    11elevenditto
    12twelveditto
    13thirteenditto
    14fourteenditto
    15fifteenditto
    16sixteenditto
    17seventeenditto
    18eighteenditto
    19nineteenditto
    20twentyditto
    21thirty
    22forty
    23fifty
    24sixty
    25seventy
    26eighty
    27ninety
    28hundred
    29thousand
    30million
    31~ty~ty suffix
    32~teen~teen suffix
    33pointDecimal point
    34degrees
    35robot
    36talk
    37o'clock
    38clock
    39computer
    40speak
    41Hello
    42good-bye
    43inches
    44meter
    45meters
    46centimeters
    47temperature
    48"I am a talking robot."
    49PAUSE
    50error
    51foot
    52feet
    53seconds
    54minutes
    55our, hour
    56ours, hours
    57day
    58days,daze
    59Ready
    60~sPluralizer
    61"How are you?"
    62"It is "
    63cold



    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.