Robosapienpet'S Supersapien Mod#1 - Sapavr

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

[AiboHack - Boneyard] RoboSapienPet's SuperSapien Mod#1 - SapAVR http://www.aibohack.com/robosap/sapavr.

htm

AiboPet's BoneYard http://aibopet.com, http://aibohack.com

WARNING: contents of this page are very old. Email: aibopet@aibohack.com


Click here for the home page

RoboSapienPet's SuperSapien Mod#1 - SapAVR

Please read the overview and general warnings about this Do-It-Yourself modification on the main SuperSapien mods page.
These pages give much general advice, as well as instructions for how to modify your robot in a way similar to mine. I've tried to pick the very lowest cost and generally
available construction alternative (ie. no replacement sockets, burn holes in the back of the robot to mount parts etc). Your esthetics may vary!
There are many other variations possible, depending on what you want to do to make your modified robot a unique creation.

WORK IN PROGRESS
The main hardware modification is complete. The firmware is still being written/enhanced.
The instructions here are intended to be minimal (leaving flexibility in part placement and wiring alternatives). If you have suggestions for improvement of the instructions,
please let me know.
Any future improvements will be in part based on the general community interest in the SapAVR modification.

Preparation!
Parts Needed

What you need:

A RoboSapien Robot (that you can afford to replace)


a 20 pin Atmel AVR chip "AT90S2313" (any speed)
a 20 pin socket for the chip
a small perf board for mounting the socket
There are other wiring variations possible, that's up to you.
thin wire (eg: wire-wrap wire)
A means of programming the 20 pin AVR chip (see below)
A PC or serial terminal for debugging (debug console)
A MAX233A level shifter for the debugging console, a power supply, and PC serial connector [temporary construction allowed]

How to program the chip

NOTE: for the early adopter version, it is up to you to figure out the best and most economical way of programming the chip. Eventually I will add in-circuit serial chip
programming to the design.

You will need a way of programming the AVR chip. If you already have access to a 'universal' chip programmers, you should see if it supports the Atmel AVR series.
Otherwise you can either buy a dedicated programmer, or build a serial one very easily.

Iguana Labs sells a stand alone programmer that programs the 20 pin Atmel chips (including the AVR, $79). Works off the serial port.
Futurlec sells a dev board for the AVR'2313 ($20, thanks to knitsu for finding this one). Works off the parallel port.
If you want to build one completely from scratch, there are several suggestions on this webpage. Not recommended for beginners.

Please Read This If this is the first time you have programmed the AVR chip, I strongly suggest you try out the firmware (see 'The Firmware' below), compiling it up using
the free tools, and burning an AVR '2313 chip using your choice in hardware. Try this before modifying your RoboSapien robot.

Buying the parts

In the USA, Jameco sells the 10MHz AT90S2313 for $3.25 per chip (20 pin DIP).
They also sell the MAX233A chip (MAX233CPP for $5.75 each) as well as the cheaper MAX232 chip (capacitors needed).

Prices and availability of this part will vary by country.


Either the full speed 10MHz (AT90S2313-10) or low speed 4MHz (AT90S2313-4) should work. In the SapAVR circuit, the chip runs at 4MHz using a lower VCC voltage
(around 3.3 or 3.5V).

Decide where to mount the chip and serial connector

Remove the back case (4 screws) and take a look at the RoboSapien's inside. You have to mount the 20 pin AVR somewhere, as well as a connector for the PC serial port (3
pins minimum).

MY CONSTRUCTION NOTES:
I melted a few holes in the back (by the speaker) to mount the AVR chip, and a 6 pin header for the external serial connector.

1 of 7 4/1/2018, 1:43 AM
[AiboHack - Boneyard] RoboSapienPet's SuperSapien Mod#1 - SapAVR http://www.aibohack.com/robosap/sapavr.htm

The PC connection

The level shifter for the PC debug console is an external circuit. It is needed for writing your own software for the SuperSapien. It can be built in a permanent fashion, or
temporary. I've use an experimenters socket board for mine, which is easy to build.

NOTE: in future serial programming may added (see schematic below, don't rely on this photo)

The Modification
Now is the time to perform the modification.

MY CONSTRUCTION NOTES:
I used wirewrap wire and a simple socket.

2 of 7 4/1/2018, 1:43 AM
[AiboHack - Boneyard] RoboSapienPet's SuperSapien Mod#1 - SapAVR http://www.aibohack.com/robosap/sapavr.htm

General disclaimer: Other installation variants are possible.

Prepare the small circuit board

Now is a good time to solder a 20 pin socket to a small board. This will make it easier to solder connections. NOTE: use a high quality socket (ZIF if you plan on switching
the chip a lot) NOTE: other wiring options are possible (eg: wire wrap socket if you have the room)

Shell - attaching board and serial connector

If not done already, remove the 4 screws holding on the back. I hope you have decided where you are going to mount the addon part. My approach was to place the AVR
chip right above the speaker (temporarily remove the 3 screw speaker holder as well), and the external connector (for the PC serial terminal) on the side. MY
CONSTRUCTION NOTES: (see photos above)
I placed a second 20 pin socket in the first one to add height.
A hot soldering iron will quickly melt the plastic shell for creating holes
A hot glue gun will attach parts (and fill in any unwanted holes)
For the serial connector, only 3 signals are required (PB.5, PB.6 and Gnd).
For future programming I exported 6 signals (Gnd, Reset, PB.5, PB.6, PB.7 and VCC)
You may want to consider what other periherals you plan on adding later, and pick the location on the robot accordingly.

Chop Chop

Now the destruction really begins...


You need to cut several wires. In this diagram, notice the places marked with red Xs. Each of those wires must be cut (and most rewired to the SapAVR board) Cut the wires
at least 1/4" next to the connector, leaving room to connect to both sides of the cut wire.

3 of 7 4/1/2018, 1:43 AM
[AiboHack - Boneyard] RoboSapienPet's SuperSapien Mod#1 - SapAVR http://www.aibohack.com/robosap/sapavr.htm

NOTE: I know the RoboSapien has all those sockets, but replacment sockets are hard to find, and not needed for the minimal rewiring done here. Your esthetics may vary!

Wire it up

4 of 7 4/1/2018, 1:43 AM
[AiboHack - Boneyard] RoboSapienPet's SuperSapien Mod#1 - SapAVR http://www.aibohack.com/robosap/sapavr.htm

Next there is wiring from the cut wires and other places on the original board to the new SapAVR board. Be sure to leave enough wire for future access and maintenance.
However don't make the wiring longer than necessary (especially the CLKIN wire). Here's a schematic/wiring diagram:

WIRING NOTES:

The Ground signal can come from a connector, or alternatively wire it to the back of the PCB.
Try to keep the CLKIN wire as short as possible
The ROUT and LOUT signals are soldered to the wire stub on the connector of the original PCB (count 4 from the top)
Tip: Wire the four switch grounds together first, then connect them with a single wire to the ground signal (NOTE: allows for easier un-modification)

Wiring up the debug terminal

5 of 7 4/1/2018, 1:43 AM
[AiboHack - Boneyard] RoboSapienPet's SuperSapien Mod#1 - SapAVR http://www.aibohack.com/robosap/sapavr.htm

A MAX233A level shifter is needed to connect the 3.3V signals from the AVR chip to your PC's serial port.
Here's a schematic/wiring diagram for the level shifter using the single chip MAX233 chip:

WIRING NOTES:

I suggest building this external to the robot. Once the firmware is debugged, you won't need the level shifter.
The circuit can be powered from 5V or 3.3V. That is officially below spec, but it works for me.
The cheaper and easier to find, MAX232 part can be used instead of the MAX233. It requires 4 external capacitors. Check this webpage for specifics of the MAX232
chip. Although a little more expensive, I prefer the MAX233 chip because it is easier to wire up.
If having problems with the 9 pin connection to the PC, try swapping pins 2 and 3.
Plan for changing this circuit in the future. I want to add another two signals to turn it into an in-circuit programmer.

The Firmware
You may want to do this part first, before physically modifying your robot.

Download Firmware

SapAVR0.1 Firmware "SapAVR0.1" is the first incomplete release of the firmware.

Hex firmware ready for program onto AVR '2313 chip - coming later.
sapavr_fw01src.zip - Source code - preview release

NOTE: Source code and firmware is copyrighted by me. You are free to use it for any non-commercial use.
If you make any general improvements that may be useful to others, please email them to me. You are under no obligation to do so (this is not GPL).

Download Free Tools

To compile the source you need the free WinAVR compiler. You can download the WinAVR compiler and other tools from http://winavr.sourceforge.net. Here's the install
guide (parts 1 to 4 apply) install_config_WinAVR.pdf .

The toolset can be complicated to setup, and is overly large for what is needed. We only need the command line tools (stop after chapter 4 of the install guide -- command
line make, compile, assemble, link, dumpobj).

The "Programmers Notepad" graphical environment is not needed.


The low cost 90S2313 does not support debugging features
The AVR-GCC library is not used in SapAVR. Not only is it very big for the small 90S2313 chip, but it doesn't provide useful features for typical SapAVR programs.

Modifying and adding your own C++ code

More details to be written. Look at 'sap1.cpp' and 'console.cpp' for the bulk of the smarts.
Size of code is an issue. There is only 2KB of code space on the AVR chip and the compiler can generate fat code. With all the features turned on, you can run out of space.
Some parts of the firmware are in assembler for size reasons.

Final Note
Any future improvements will be in part based on the general community interest in the SapAVR modification. [ie. if other people do the hardware mod, and at least try to
write some software] If you have suggestions for improvement of the instructions, please let me know.

6 of 7 4/1/2018, 1:43 AM
[AiboHack - Boneyard] RoboSapienPet's SuperSapien Mod#1 - SapAVR http://www.aibohack.com/robosap/sapavr.htm

7 of 7 4/1/2018, 1:43 AM

You might also like