Sie sind auf Seite 1von 7

6/3/2015 BasicX­24

DC Motor Controllers  Evosapien Community


Robosapien.tk Community
Up to 2x150A. Advanced features USB, Serial, Analog or RC Interface Forums

This site was last updated:
January 08 2005 Wow Wee 2006 Robot
Line is out.. CLICK
HERE to check out my
I modified my Robosapien with the BasicX­24
page about it, which will
Microcontroller and and Ramb board from
constantly be updated to
Robodyssey that supports carrying the chip, and
able to program via db­9 cable to a PC. show users t he new
pictures, or videos t hat
Current add­on is a Sharp Sensor, attached to his might come out!!! Wow
face for avoiding walls, future plans include Wee has their own
Photocell, and also Motor Controller for increase Software NOW!!
in leg walking and also arm support, (not chip YaY!!!!
related, springe enhancement)
Schematic Overview: basically the thick black wire inside RS has 7 wires or
so, you need to CUT/STRIP/SOLDER the Black and White Wire as it looks
on the Diagram

Click Here to watch
Mark Tilden, V2,
Roboraptor on the
Gadget Show  10mb   
4:42 Min

This is what you get
when you get 2 RSv2’s
with fresh batteries,
Robopet, Roboraptor, 
and 3 V1’s  all in the
same room, fighting over
Notes: This shows the Robosapien iR(infrared) tapped into using the RAMB board and the Basic X what to watch on the
24 Microcontroller, the chip is on the Ramb board, look above for pictures of the actual hardware. TV!!!
A few notes to meantion for “advanced” users this RAMB board has cut out some of the Pins
BX­24 uses for other things, and were not added, so no one “screws” it up, I will post a PIN #
diagram so stuff will be alot easier, look for that in the comming day or June 13­14

<==

Beside this is a diagram of where the
DIODE and the RESISTOR go. in the
original Hack­A­Toy these components
were not added, but as meantioned in
Thandleys BX­24 Experiences He used this
to not fry the IC Controllers, if you dont
have it, more then likely your RS can EvoSapien 
handle it, as other RS have used this mod Nocturnal Robosapien Site
w/out it for hours upon hours and no RoBBoTT's Neon Mods site
effect has happened, but just as a Sprocket2Cog's
precaution I would make sure you have

http://www.evosapien.com/robosapien­hack/knitsu/html/basicx­24.html 1/7
6/3/2015 BasicX­24
that.... click the Image to see a detailed RoboRaptor site
artitcle + a bigger picture to wire that
together

I learnt this from reading documents on BX­24 RS related Mateiral off his site, which is in my links if you
want to check it out, he also has alot of other BX­24 RS mods he has done. but I am pasting his
documents below since they are all finely tuned :­) you could say

A word of Caution... DO NOT try to drive 5V TTL levels from the BX­24's Outputs to the Controller Board's
Inputs or you will Damage the Controller IC! The following schematic is a simple SCHOTTKY Diode Clamp
which will 'Clamp' the BX­24's Output to within 0.3V of VCC (3.3V):

You can use most any SCHOTTKY Diode (DO NOT use a Silicon Diode!). I'd recommend the 1N5817,
1N5818, or 1N5819 since they are easy to find. The following describes how to install it. Refer to the diagrams
below: Looking at the back of the controller board with the longest side on top, note the 10­pin connector that
connects to RoboSapien's Head. The third pin from the left is the IR input and there is a blank pad just to the
lower left of the pin labeled "IR" or "IR­OUT". Connect the diode's Anode to either the pin or the pad.

Now, looking at the upper left 4­pin connector, while it's not labeled, the third pin from the left is VCC. On my
board the left pin is labeled "M4+", the next is "M4­", the third is not labeled and the fourth is labeled "P1.6".
Slide some heat shrink or other tubing over the diode and connect it's Cathode to this pin.

Next add a 2.2K resistor from the BX­24's Output to the IR input where the diode's Anode is connected. You
can use any wattage resistor like a 1/8W or 1/4W or even an SMD package.

To isolate the IR Sensor, remove the 3rd wire from the Female connector that connects to the IR Input on the
Controller Board. In my case, it's a White wire. Connect this wire to the pin you are using on the BX­24. The
reason for this is that pin is used for the InputCapture() procedure.

In my interface, I used Male and Female 'break­away' headers based on 0.1" centers and ribbon cable. These
are real common and easy to obtain. I used a 2­pin Male header connected to the resistor above and GND on
the Controller Board header. Next, I used a single wire soldered to the IR Sensor wire with Heat Shrink tubing,
connected to a single Female header. That allows me to either connect the two for normal operation or isolate
them for connecting to the BX­24.             ­ Thandley

BUILDING A PROGRAM TO GO WITH ROBOSAPIEN...... IR
CODES/ HEX CODES AND BINARY  AND CODE FOR BASIC X
PROGRAMMING, HOW IT ACTUALLY WORKS...
But why not take a 'Chance' and get to know what Binary really is, well not really, but an understanding of it...
got 0­1 minute ?? ;­)

This is a list of IR Commands referenced to the RoboSapien manual. Values
are in Hex and (Decimal) format. For a complete list of standard and secret
commands as well as detailed IR timing information, check this site:
http://www.aibohack.com/robosap/ir_codes.htm
I have modified this list to display the Binary Value of each command for people who use Robodyssy, or my
Program, as well as give you an understanding of what is actually going on 

Red Commands:
=============
(Page P.7)
81 (129) ­ Right Arm Up 10000001
84 (132) ­ Right Arm Down 10000100
85 (133) ­ Right Arm In 10000101
82 (130) ­ Right Arm Out 10000010
83 (131) ­ Tilt Body Right 10000011

89 (137) ­ Left Arm Up 10001001
8C (140) ­ Left Arm down 10001100
8D (141) ­ Left Arm In 10001101
8A (138) ­ Left Arm Out 10001010
8B (139) ­ Tilt Body Left 10001011

(Page P.8)
80 (128) ­ Turn Right 10000000
88 (136) ­ Turn Left 10001000
86 (134) ­ Walk Forward 10000110
87 (135) ­ Walk Backward 10000111
8E (142) ­ Stop 10001110

http://www.evosapien.com/robosapien­hack/knitsu/html/basicx­24.html 2/7
6/3/2015 BasicX­24

92 (146) ­ Right Sensor Program 10010010
94 (148) ­ Sonic Sensor Program 10010100
93 (147) ­ Left Sensor Program 10010011
90 (144) ­ Master Command Program 10010000
91 (145) ­ Program Play 10010001

Green Commands:
===============
(Page P.9)
A1 (161) ­ Right Hand Thump 10100001
A4 (164) ­ Right Hand Pickup 10100100
A5 (165) ­ Lean Backward '10100101
A2 (162) ­ Right Hand Throw 10100010
A3 (163) ­ Sleep 10100011

A9 (169) ­ Left Hand Thump 10100001
AC (172) ­ Left Hand Pickup 10101100
AD (173) ­ Lean Forward 10101101
AA (170) ­ Left Hand Throw 10101010
AB (171) ­ Listen 10101011

A0 (160) ­ Right Turn Step 10100000
A8 (168) ­ Left Turn Step 10101000
A6 (166) ­ Forward Step 10100110
A7 (167) ­ Backward Step 10100111
AE (174) ­ RESET 10101110

B2 (178) ­ Right Sensor Program Execute 10110010
B4 (180) ­ Sonic Sensor Program Execute 10110100
B3 (179) ­ Left Sensor Program Execute 10110011
B0 (176) ­ Master Command Program Execute 10110000

B1 (177) ­ Wake Up 10110001

Orange Commands:
================
(Page P.11)
C1 (193) ­ Right Hand Sweep 11000001
C4 (196) ­ High 511000100
C5 (197) ­ Right Hand Strike 1 11000101
C2 (194) ­ Burp11000010
C3 (195) ­ Right Hand Strike 2 11000011

C9 (201) ­ Left Hand Sweep1 1001001
CC (204) ­ Talk Back11001100
CD (205) ­ Left Hand Strike 1 11001101
CA (202) ­ Whistle11001010
CB (203) ­ Left Hand Strike 2 11001011

(Page P.12)
C0 (192) ­ Right Hand Strike 3 11000000
C8 (200) ­ Left Hand Strike 3 11001000
C6 (198) ­ Bulldozer 11000110
C7 (199) ­ Opps! 11000111
CE (206) ­ Roar 11001110

D2 (210) ­ Demo 111010010
D4 (212) ­ Dance 11010100
D3 (211) ­ Demo 211010011
D0 (208) ­ All Demo 11010000
D1 (209) ­ Power Off 11010001

NOTES: 
add $08 to go from right­side commands to left­side commands. 
add $20 to command bytes for the GREEN shift (ie. $Ax and $Bx range) 
add $40 to command bytes for the ORANGE shift (ie. $Cx and $Dx range)
 

­­­­­­­­­­­­­­­­­=============================­­­­­­­­­­­­­­
Example #1

Sub Roar()'Roar '11001110 (name, command, binary)
CE (206) ­ Roar 11001110 (hex, decimal, Command, binary)

Sub LHandSk1()'Left Hand Strike 1 '11001101 (name, command, binary)
CD (205) ­ Left Hand Strike 1 11001101 (hex, decimal, Command, binary)

­­­­­­­­­­­­­­­­­=============================­­­­­­­­­­­­­­
Example #2

Tutorial on Binary: thought it might be good sure helped me ;­) 

Humans have ten fingers, and so it's not so surprising that many cultures throughout history have used
base 10. Digital computers use base 2 or binary number representation, each digit of which is known as
http://www.evosapien.com/robosapien­hack/knitsu/html/basicx­24.html 3/7
6/3/2015 BasicX­24
a bit (binary dig it). Here, each bit is represented as a voltage that is either "high" or "low," thereby
representing "1" or "0", respectively. To represent signed values, we tack on a special bit ­­ the sign bit ­
­ to express the sign. The binary addition and multiplication tables are 

0 + 0 = 0
1 + 1 = 10
0 + 1 = 1
1 + 0 = 1
0 + 0 = 0
0 + 1 = 0
1 + 1 = 1
1 + 0 = 0

(1) 
A carry means that a computation performed at a given position affects other positions as well. Here,
1+1=10 is an example of a computation that involves a carry. Note that if carries are ignored,
subtraction of two single­digit binary numbers yields the same bit as addition. Computers use high and
low voltage values to express a bit, and an array of such voltages express numbers akin to positional
notation. Logic circuits perform arithmetic operations. 

ok so were going to find out where each binary bit is placed on the BX­24 basic X coding.... 
 

AC (172) ­ Left Hand Pickup 10101100 (hex, decimal, Command, binary)

it is really simple to sort out 1 being highbit, and 0 being the lowbit
the coding is simple on the BX­ as a simple 1 is represent by a "HighBit" name ....

Call Pulseout(Sapien,HighBit,1) 'This equals 1 Binary
Call Pulseout(Sapien,Clockbit,0)

The 0 is represented by 

Call Pulseout(Sapien,LowBit,1) 'This Equals 0 Binary
Call Pulseout(Sapien,Clockbit,0)

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­============================================­­­­­­­­­­­­­
REFER TO THIS EXAMPLE TO SEE HOW EACH BINARY BIT IS PLACED 

Sub LHandPick()'Left Hand PickUp '10101100 would be displayed something like this on the chip

Call Pulseout(Sapien,startbit,0) ' bit to start sending commands

Call Pulseout(Sapien,HighBit,1) '7 bit 1
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '6 bit 0
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '5 bit 1
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '4 bit 0
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '3 bit 1
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '2 bit 1
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '1 bit 0
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '0 bit 0
Call Pulseout(Sapien,Clockbit,0)
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­=======================

Definition of these Values..... and how they add up to one full command (walk forward)

This code listed below is inserted at the beginning of your project so each bit of binary can be properly
converted and used to move your Robosapien robot.

Public Const StartBit as single = 0.006664 'Time it takes for the start bit to start a command

Public Const LowBit as single = 0.000833 'Time it takes for the low bit = 0 
Public Const HighBit as single = 0.003332 'Time it takes for the highbit = 1

Public Const ClockBit as single = 0.000833 'Clock bit time ' second # in the 1binary bit code = 0

you place a start bit at the beggining of each command you are going to create.. so you would do this by 

Call Pulseout(Sapien,startbit,0) ' bit to start sending commands

now we have to call the HIGH/LOW and Clock Bit for each bit of Binary we have to deal with. We have
http://www.evosapien.com/robosapien­hack/knitsu/html/basicx­24.html 4/7
6/3/2015 BasicX­24
8 peices of Binary, which means that we will basically have 8 questions, with an a) an b) value making
the final value for that bit of Binary ....

This is a very easy thing to do, as we can sort out 1 or 0 for each 8 of the Binary values by seing if it has
a HighBit or a LowBit Value in it....

Call Pulseout(Sapien,HighBit,1) = 1 binary bit

Call Pulseout(Sapien,LowBit,1) = 0 binary bit 

followed by the next command which gives a 0 binary bit to the ClockBit Value...

Call Pulseout(Sapien,Clockbit,0)

Full code would look like this 

Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)

and once calculated using this little chart below or binary tutorial above we will get 1 full binary bit
Value to the 8 Bit Value that is needed to do a command on Robosapien

0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
0 + 0 = 0
0 + 1 = 0
1 + 1 = 1
1 + 0 = 0

so that example above: 

Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)

Would be a Binary value of 1 

***********TEST*****************
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
TEST YOUR SKILLS
­­­­­­­­­­­­­­­­==========

(QUESTION A) HOW MANY 1 ARE IN THIS BINARY DATA?

Sub LHandSk1()'Left Hand Strike 1

Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)

(QUESTION B) what is the Binary value of this Command
 

Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)

http://www.evosapien.com/robosapien­hack/knitsu/html/basicx­24.html 5/7
6/3/2015 BasicX­24

Call Pulseout(Sapien,HighBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)

(QUESTION 3 ) what is the BINARY READING for this Value?

Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,LowBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)

Call Pulseout(Sapien,HighBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)

[b]

**************ANSWERS AT BOTTOM OF DOCUMENT*******************

http://www.evosapien.com/robosapien­hack/knitsu/html/basicx­24.html 6/7
6/3/2015 BasicX­24

[Index] [Contest] [About Me] [About RS] [My RS Mods] [Projects] [BasicX­24]
[Autonomous v.1.1] [Autonomous v.1.2] [My Pics] [robopet] [My Video] [RS Help!]
[RS V2] [2006 Wow Wee] [News Archives] [Links] [==v2home] [===Evosapien]
[===CES2006] [USBVision pics]

http://www.evosapien.com/robosapien­hack/knitsu/html/basicx­24.html 7/7

Das könnte Ihnen auch gefallen