Marsette Vona: Billy Bass Hack

Note: The information on this page describes a hack for the "Billy Bass", which is a different model of talking fish than the "Boogie Bass".

Susanna Shaw sends pics of her completed fish!

The Billy Bass hack adds a 20 second re-recordable "special" message to the Billy Bass talking fish made by Gemmy Toys. The movements of the head, tail and mouth are also re-recordable, and the original factory messages are still available. The hack is built around three main components:

  1. The ISD 1420P solid-state "chipcorder" voice record/playback chip (PDF Datasheet Part 1, Part 2, Part 3). Stores 20 seconds of telephone-quality voice. Nonvolatile, in-system-recordable. 28 pin DIP. Available from JDR Microdevices for about $9.
  2. The ATMEL AT89S8252 microcontroller (PDF Datasheet). 8051 core. 8kB of serial-downloadable flash program storage. 2kB of data storage EEPROM. 40 pin DIP. Available from JDR for abut $7. The special head/tail/mouth movements are stored in the 8252 EEPROM. The 8252 also serves as the "brain" of the Bass when it's in special mode: it manages the switches which set the special sub-mode, it watches the front-panel pushbutton and the motion sensor for events, it triggers the head/tail/mouth motor driver circuits, and it controls the 1420.
  3. An MC34119 (PDF Datasheet) audio amplifier allows us to use the 8-Ohm speaker that comes with the Bass for both special and normal modes.

UPDATE 8/17/04: John Greene reports that some of the above suppliers no longer carry the listed parts, but that Futurlec currently carries all parts except the 4PDT switch and the MC34119 (which seems to be discontinued).

 

Photo 1 shows the layout of the inside of the hacked Bass.

Photo 1: Hacked Bass internals.
 

As you can see, most of the added circuitry is collected onto a perfboard. Photos 2 and 3 show the top and bottom sides this board.
Photo 2: Top view of special circuit board. The large chip is the 8252, the medium-sized chip is the 1420, and the small chip is the 34119.
 
Photo 3: Bottom view of special circuit board.
 

Controls and Operation

SW4 toggles the Bass between normal and special mode. In normal mode the Bass should behave as it always has. In special mode, the operation of the Bass depends on the settings of SW1..3, which set the current "sub-mode". There are currently six such sub-modes:

Record
This is the mode for recording a new message, up to 20 seconds long. Only one special message is supported at a time. When the button on the front is pushed and held in, any sound will be recorded until the button is let out (or 20 seconds is reached, whichever happens first). New special messages can be re-recorded as often as you like, and doing so will erase the existing special message (and reset all head/tail/mouth movements).
Record Mouth
In this mode the movement of the mouth can be recorded. Press and release the button on the front to start playback of the special message, along with any existing recorded tail and head movements. While the message is playing, press and hold the button to open the mouth. Release to close it. The mouth movements recorded here will be played back subsequently whenever the message is played in Play, Record Head, or Record Tail modes. It can be difficult to get the timing right, so it helps to have a digital stopwatch on hand. And you can of course re-record the movements as many times as you like (re-recording the movement does not erase the current audio or movements of the other body parts).
Record Head
This mode allows the movement of the head (either flat against the plaque or turned to face you). Operation is similar to Record Mouth mode.
Record Tail
This mode is for recording tail movements. Operation is similar to Record Mouth mode.
Play (button only)
When the button is pushed and released in this mode the currently stored message is played back, along with any recorded head/tail/mouth movements.
Play (button or motion)
Same as play mode except the motion sensor will now trigger playback (for this to work the original Bass motion sensor enable switch must be in the "on" position).

If you build the circuit according to the schematic, the Special Sub-Mode switches work like this:

Special Sub-Mode SW1 SW2 SW3
Record short short short
Record Mouth open open short
Record Head open short open
Record Tail short open open
Play (button only) open open open
Play (button or motion) open short short

There is also a trimpot for adjusting the volume in special mode (visible just above the 34119 in Photo 2) and an LED (very useful during software development).

Design Documents

The schematic diagram, parts list, and all necessary code files are available either as a GNU/Linux tarball or as a DOS zipfile.

Power Supply Details

The Bass is designed so that it can either be powered from four onboard C cells or from a wall-wart power transformer. The Bass actually comes with batteries (woo-hoo!) and with a female coaxial power jack for the wall-wart.

I had originally planned to use a 7805 regulator to supply power to my added circuit from either the batteries or the wall supply. However, I quickly discovered that the 6V available from the batteries does not leave enough voltage headroom for a regular 7805, especially when the motors are energized (because the high current drain causes the battery voltage to dip significantly). It may be possible to circumvent this issue by using an LDO (Low Drop-Out) regulator.

It turns out that a regulator seems to be unnecessary for this circuit when powered from the batteries. We do need to be a little careful because the specified maximum operating voltage of the 8252 is 6.6V, and freshly charged cells in some chemistries may surpass this. However, unless you get a regulated wall-wart (which are less common than the unregulated variety), regulation is necessary when using the wall-wart. So I moved the 7805 to the wall-wart jack. This way when the wall-wart is connected the Bass is supplied through the regulator, but when the wall-wart is not present the juice comes directly from the batteries. I found that a 9V DC 500mA wall wart from JDR Microelectronics (part tr09-DC) seems to work pretty well wall-wart-polarity.

Internally, the coaxial jack has three terminals. One carries +V in from the wall-wart, one is system ground, and the remaining one is battery ground. The terminal with the lone black wire going to the negative side of the battery pack should be battery ground, the one that connects to the outer conductor on the coaxial jack should be system ground, and the remaining terminal should be +Vin (it had a pink wire attached in my Bass). The jack has a switch in it that will automatically connect auxiliary ground to system ground when the wall supply plug is not inserted, and disconnect them when it is. This effectively isolates the batteries when the wall supply is connected. Be careful not to subvert this switch -- if you do, you could inadvertently cause the wall supply to drive current through the batteries, which could be A Bad Thing (before and after you finish your work, verify the proper operation of the switch with a continuity tester: when the wall-wart is inserted there should be no continuity from the negative terminal of the battery pack to system ground).

Photo 4 shows the 7805 mounted to the wall-wart input jack.

Photo 4: 7805 regulator mounted at the wall-wart jack.
 

Of course, as in any mixed signal circuit, you should keep separate power and ground nets for the analog and digital portions. Keep them separate until as close to the supply points as possible. If you have audio noise problems, especially if it only occurs when the motors are energized, then check your supply voltages.

The special circuit draws about 13mA when powered on. However, the 8252 is programmed to shut everything down after about 25 seconds of inactivity. In this low-power mode, the special circuit draws only about 0.3mA. C cell batteries typically have capacities in the range of 5000mA-H, so the Bass should be able to sit idle for months without draining its batteries. And when you do need to change the batteries, you will be happy to find that since both the memory on the 1420 and the EEPROM on the 8252 are non-volatile, you will lose neither the audio nor the motions of your carefully recorded special message.

Programming the 8252

The AT89S8252 is mostly backward-compatible with the original 8052 microcontroller mcs-51. All the code that runs on the 8252 is contained in the assembly language file bass.asm (included with the design documents).

I used the freely available assembler as31 to produce an Intel format hex file (bass.hex) from the assembly code. Before I run bass.asm through as31 I pass it through the C preprocessor, which allows us to define bit addresses as named symbolic constants (which as31 apparently does not handle well). Also this would allow for conditional assembly if needed. However, the C preprocessor is not an ideal solution. Unmatched single or double quotes anywhere in this bass.asm will make the C preprocessor choke (except if enclosed in C-style /* comments */), assembly-style ; comments on the same line after #define statements will misbehave, and when you get an assembler error the line number reported actually refers to the post-c-preprocessed file (which will be bass.p.asm).

I provide a makefile with the design documents, so if you are on a GNU/Linux system all you should need to do to build bass.hex (after you have installed as31) is type

> make bass.hex
It should also be possible to build bass.hex from bass.asm on any system where both the C preprocessor and as31 run, however I have only tried it on GNU/Linux so far. You can probably get the code to build with your own favorite 8052 assembler that isn't as31 if you make some syntax adjustments.

Of course, if you're not interested in playing with the code at all then you should be able to just use the Intel hex file that I provide you (bass.hex, included with the design documents), which you can send directly to a programmer.

Don't have a programmer? No problem. It's easy to build one that connects to a PC parallel port. That's the major reason I chose the AT89S8252 for this project (I didn't have a programmer either). Get yourself a 40 pin ZIF socket for the 8252 zif. Connect it as shown in the circuit diagram 89prog.pdf, which is included with the design documents.

Now you need a program to run on your PC that twiddles the bits on the parallel port in just the right way so that the contents of your Intel hex file get transferred to the 8252. A web search turned up a guy named Rob Melby wrote just such a program, called 89prog, for GNU/Linux. I added some improvements to it, for example now the timing should be independent of the machine you run it on, and it will now run under DOS as well as GNU/Linux 89prog-mod. Source code (89prog.c) and compiled executables (89prog for GNU/Linux and 89prog.exe for DOS) are provided with the design documents. Hook up your programmer to the parallel port, insert your 8252, and power up the programmer. Run 89prog, feeding it your Intel hex file like this:

> 89prog bass.hex
If your parallel port is not at the common address of 0x378 you will need to specify the address explicitly on the command line. Run 89prog without arguments to get a usage message that explains how to do this.

Construction Notes

Be careful when you disassemble the Bass. It's easy to break wires off, especially at their solder points. See my little tirade below about strain relief.

It's tricky to mount the toggle switch, the mode switches, the LED, and the microphone in the Bass. You will need to get creative here. I recommend trying to mount everything on the rear surface of the Bass' plaque, so that from the front the Bass does not appear to be modified. Be sure to have some gap-filling superglue and some hot-melt glue on hand.

When attaching things that stick out the back of the plaque, keep in mind that if you want to be able to mount it on the wall then whatever you attach will need to protrude less than the mounting feet do. This can complicate things, for example in order to mount SW4 I ended up soldering a stiff wire loop to its knob so that I could mount the switch parallel to the back plate of the plaque. This technique is shown in Photo 5.

Photo 5: Mounting technique for SW4.
 

As shown in Photos 2 and 3, I used a JALPC-3 solderable perfboard from Hosfelt Electronics to build the bulk of the circuit. Point-to-point wiring is used throughout. Use sockets for each of the ICs, and complete all soldering and check everything twice before you insert them.

You'll find that there will be quite a few wires to connect the circuit boards and other parts together. Use stranded hook-up wire, and be very careful about strain-relieving it at each end. For example, when attaching a wire to the added board, you may want to slightly enlarge one of the holes xacto-reaming, pass the wire with insulation through the enlarged hole (from the component side to the solder side), and then solder the wire down. When connecting the head/tail/mouth control wires to the original board you will probably want to use plenty of hot-melt glue for strain relief. In fact, you should also put big blobs of hot melt around the solder points of all the original wires in the Bass. There will likely be a lot of playing around and rearranging things as you work and it will be really annoying if during all this you overstress some wires and break them off.

Future Work

In-System Programming
isp
Serial Interface
The 8252 has a UART on it that we aren't using yet. It might be cool to hook up a MAX232 level-converter and a connector so that we can communicate directly with the Bass from a PC.
Multiple Messages
As it is, only a single 20-second or less special message is supported. The 1420 is addressable, and it should be possible to support multiple messages (which sum to 20 seconds or less).

Please let me know if you complete any of these modifications, or if you think of any other good ones.

References

Footnotes

isp
In this Bass design the 8252 is not in-system programmable. However this appnote contains useful information for those who would like it to be. It's also a good read for general info about serial programming the 8252. The main issue is that you need to latch the outputs of the 8252 that connect to the Bass and to the 1420 while it's being programmed.
speaker
This design uses the speaker that comes with the Bass for both normal and special mode. Of course, the microphone had to be added.
other-fish
Boogie Bass, Bob "the bastard" Blowfish, Travis the Talkin' Trout, Dumb Ass Bass, Dumb Ass Santa Bass (these last two are only virtual talking fish)
mcs-51
Intel's name for the 8051/52 series is MCS-51.
zif
You may want to get an additional 40 pin ZIF socket to install in the Bass. Just plug it into the regular 40 pin socket that you have there for the 8252. This way it's much easier to move the 8252 between the programmer and the Bass while doing the assemble-burn-test dance.
89prog-mod
You will need GNU/Linux kernel >= 2.0 to run 89prog.
xacto-reaming
A convenient way to enlarge holes in plastic is to ream them out with an exacto knife. Just insert the knife, push and twist.
wall-wart-polarity
The polarity (i.e. whether the inside conductor is + or -) is not standardized across all wall warts. Be careful to use one that agrees with the Bass (center positive), or to modify the one you have so that it does.

Bass Hack in the News

These pages have had over 100,000 hits since creation.

Please feel free to email me if you are interested in the Bass. I regret that I may not be able to reply personally to all email received.

I, Marsette Vona, have no relation to the manufacturer of the Boogie Bass, the Billy Bass, or to any other company mentioned on this page. Modifying your Bass as described on this page will likely void any warranty that it may come with.

THIS INFORMATION AND/OR SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS INFORMATION AND/OR SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 

vona@mit.edu © 2008 Marsette Vona Thu Oct 2 13:10:22 EDT 2008