Radio Shack Mobile Robot manual Coprocessor Command Summary, Example !1M11200E7

Page 36

Coprocessor Command Summary

This section describes how the coprocessor works and how each command is constructed.

The controller board contains a coprocessor that is used to control the drive motor, powerful output, en- coder sensor, and the 4 RC servo motors (#1 is used as the steering motor). This frees the Basic Stamp

IIfor other tasks. The coprocessor receives commands from the Basic Stamp II via the coprocessor net- work bus on pin P8. SERIN and SEROUT commands are used in PBasic to communicate with the co- processor. Each command sent to the coprocessor is preceded by a “!“ start character and an address character. This allows other coprocessors to be attached to the network.

The coprocessor responds to some commands by returning an “A” to indicate “acknowledged”. The co- processor never speaks until spoken to – this is called a “Master/Slave“ network. The Basic Stamp II is the master and the coprocessor is the slave. This creates a multi-processor system.

Each command intended for the motor control coprocessor begins with “!1”

Drive Motor Control:

Example: !1M11200E7

The command begins with “!1M1” to indicate the drive motor. The next character (1 in the example) indicates the direction 1=forward, 0=reverse. The next character (2 in the example) is the speed which should be 0, 1, 2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,A. Speed of 0 is off, A is full speed. The next 4 characters are the desired encoder count in hexadecimal (00E7 in the example). Each encoder count represents about 1/2” of travel. When this command is given the current encoder count is reset. If the command is accepted, an “A” will be returned indicating “acknowledged“.

Read The Encoder Count:

Example: !1E1

This command asks the coprocessor to return the current encoder count as 4 hexadecimal digits which represents the current distance that the robot has traveled. Each encoder count represents about 1/2” of travel.

Continued on next page…….

33

Image 36
Contents Assembly and User Guide ARobot Mobile Robot Connectors Introduction About ARobotBasic Stamp II Control Computer Feature List What You’ll NeedTechnical Specifications Precautions Component Locator ControllerGlossary of Terms Glossary of Terms Glossary of Terms Assembly Overview Parts Quantity Description Used ForAbout Screw, nut, and washer sizes Parts Motor Brackets Painting SandingPaint Primer Finish CoatWhiskers SummaryHow it Works Whisker Detail Full Scale Whisker Wire Pattern Drive Motor and Brackets Encoder Sensor Front Wheel Assembly Steering Motor and Rear Wheels Steering Motor Mounting Wheel and Axle Steering System Controller Board Battery Pack Don’t install batteries yetSummary Don’t install batteries yet Body Cable Finishing Up Basic Stamp II Installation About the Controller BoardProgramming Cable to your PC PC Editor/Downloader SoftwareUSB Port Programming NoteSteering Adjustment Program STRAIGHT.BS2 ProgramsTest Program TEST.BS2 Wander Program WANDER.BS2About the Controller Board Power On/Off Switch Reset ButtonBatteries LED indicators SpeakerPush Buttons and Jumpers switches Drive Motor and EncoderSteering Motor Coprocessor Command Summary Example !1M11200E7RC Servo Motor and Steering Motor Control Coprocessor Communication RulesHexadecimal, Binary, Bytes, Words, etc Battery Connector J9 Body Connector J8Serial Port J12 PinoutRC Servo Motor Connectors J2-J5 Drive Motor Connector J10Powerful Connector J11 Voltage 12 volts Maximum Current 500ma PinoutExpansion Connector J1 Expansion Port RC Servo Motor SignalsExpansion Port Circuit Examples Switch Input Example Digital/Power OutputDigital Inputs Sensor Input ExampleAnalog Inputs Basic Stamp II light sensor example codeCoprocessor Network Expansion CommunicationsUsing Other Controllers Using ARobot’s controller as a coprocessorCabling between ARobot’s controller and another controller Suggested Reading Component Suppliers Sava Industries Small PartsStock Drive Products SuperCircuitsInternet Robot Resources Web SitesInternet News Groups Newsgroup NameDescriptionTroubleshooting Warranty Information Arrick RoboticsRobotics.com