BrainStem Console - Getting Started
Last Modified: 2009-11-05
find:

basket

Acroname Robotics  

Related
Products

Product image for BrainStem Moto 1.0 Module
BrainStem Moto 1.0 Module

Contents

About the BrainStem Console

The Console provides the main terminal into the BrainStem Modules.  Overview information can be found at the Software Technologies - aConsole page. 

Before you Begin

To set up communication between the host computer and your BrainStem module, you need the interface cable appropriate to your host computer platform. 

Downloading and Installing the aConsole

If you do not already have the aConsole software, you will need to download it from the Acroname Download Center.  Software is grouped by product. 

For example, if one intends to interface a BrainStem GP to the aConsole on a Windows based operating system, on would download the "GP Support" for Windows.  Inside the "acroname/aBinary" directory is the aConsole application. 

Connecting to a Physical BrainStem

Plug the host side of the interface cable into your host computer.  If your computer has more than one serial port, note which serial port you plug it into.  On the PC, the COM1 port is the default.  To use other ports, you need to add a configuration file. 

Plug the stem side of the interface cable into the BrainStem Module.  The serial port on the module has 4 conductors and is below the LEDs.  Take care to observe the correct orientation when plugging the cable into the module, as shown in the diagram. 


Ground wires are always oriented away from the status LEDs for the serial, power, and bus interfaces.

Power up the module.  Refer to the specific module descriptions for power supply requirements and considerations.  Take care to get the orientation correct when plugging in the power to the module as shown in the diagram. 

Several things occur:

  • The steady red power LED on the module indicates that the board has power. 
  • The blinking green heartbeat LED on the module indicates the link between your module and the host computer running the aConsole program is configured correctly. 
  • The red LED on the module side of the interface cable indicates the interface cable has power. 
  • The yellow LED on the interface cable's host side indicates the host is providing an RS-232 signal. 
  • A heartbeat indicator (O o) will toggle at the command line prompt to indicate a linked and healthy status to a BrainStem. 

Launching aConsole

The aConsole enables you to provide inputs, view outputs, and check the health of your connection.  Launch the Console application.  The Console displays a welcome and some version information. 

Screenshot of aConsole showing major UI elements.
Output after launching the aConsole application using Mac OS X Terminal.
  • Output Area - Displays outputs from the aConsole as well as from the BrainStem module's TEA programs.  The area is the command window. 
  • Heartbeat Indicator - Blinks to signal the link between your aConsole and your module is healthy, the application is working correctly on your host computer, the module has power, and the module is functioning and configured properly. 
  • Input Area - Provides an area to enter packets and commands to compile and load TEA programs, run batch files, and send commands. 

Power Cycle a BrainStem

Power cycling the BrainStem will provide feedback to the aConsole.  With appropriate link settings, one will see:

< 02:cmdMSG("power up reset") o brainstem>

The "<" character indicates data coming back from the BrainStem.  The next bit of information is the module address (02 - default value for BrainStem GP modules).  After the colon ":", the BrainStem command is decoded and printed.  The command cmdMSG was sent by the BrainStem, which has a message code of 4.  The message code "4" indicates a "power up reset". 

Command Packet Communication

BrainStems core operation mode is to respond to structured command packets.  Command listings can be found in the BrainStem reference manual. 

Each packet consists of an address, length byte, and data.  The length byte is not displayed in the output and you don't need to type it in.  When you are typing the packets in, the parser figures out the length based on the number of bytes you type.  Similarly, the length of an inbound packet (from a module) is easily deduced from the number of data bytes following the address.  These are handled automatically to make things easier when working with packets. 

Round trip communication can be tested by sending a debug packet to a BrainStem.  For this example, we send the values 1, 2, 3 and 4 to the BrainStem.  The packet sending is shown after the ">".  Once the BrainStem receives the packet, it sends it back up to the host, indicated by the "<". 

brainstem> 2 23 1 2 3 4 > 02:cmdDEBUG(01, 02, 03, 04) < 02:cmdDEBUG(01, 02, 03, 04) O brainstem>

Many BrainStem module system parameters can be adjusted using the aConsole application.  Settings such as I2C data rate, module address, router address, serial baudrate and many more can be adjusted by manipulating system properties. 

One visual method of adjusting system parameters is to manipulate the heartbeat rate.  For example, to adjust the heartbeat rate to 5.12 milliseconds (default is 25.6 milliseconds, increment of 2.56 milliseconds), send a cmdVAL_SET packet as follows (assuming module address 2):

brainstem> 2 18 2 2 > 02:cmdVAL_SET(02, 02)
  • 2 is the address of the module
  • 18 is the cmdVAL_SET command
  • 2 is the parameter ID for the heartbeat rate
  • 2 is the value
Note:

Remember to save your changes when adjusting module parameters.  The heartbeat rate, as well as other settings can be manipulated while the BrainStem module is running - but they are not automatically saved.  Send the cmdVAL_SAV packet to save settings.  Unless saved, the original settings are restored when the module is powered up again. 

Info:

Heartbeat packets are automatically handled by the underlying aStem shared library that the Console uses to communicate with the link, which is why you don't see them in the Output Area. 

Working with aConsole

TEA programs and reflexes need to get loaded onto a BrainStem before they can be executed.  The leaf and steep utilities are compiling tools.  The "load", "batch" and "launch" utilites are built into the aConsole application as they are link dependent.  These tools will not do any good if a BrainStem link is not established.  Detailed command usage examples are provided in the Getting Started Guides. 

Items in blue are some commonly used commands when using aConsole.  Items in red are files created by an individual. 

commands available in aConsole

"stat" is a very simple command that displays information about your Console application.  In the Console input area, type:

stat

A list of version and installation information displays in the Output Area.  (It is critical to include this information with any support requests you may have for Acroname.)

If you have large numbers of packets to get to the BrainStem Module, you can use the batch command instead of typing them by hand.  To use the batch command, create a new file using a text editor and name it "test.bat" Save the file in the aUser subdirectory under your main acroname directory.  In this file, type the following lines:

/* filename: test.bat */ /* Send a few debug packets */ /* Comments get taken out when run through aConsole */ 2 23 1 2 2 23 3 4 2 23 5 6

Now you have a batch file that can be used from the aConsole by entering:

brainstem> batch test.bat executing batch file test.bat brainstem> 2 23 1 2 > 02:cmdDEBUG(01, 02) brainstem> 2 23 3 4 > 02:cmdDEBUG(03, 04) brainstem> 2 23 5 6 > 02:cmdDEBUG(05, 06) < 02:cmdDEBUG(01, 02) < 02:cmdDEBUG(03, 04) < 02:cmdDEBUG(05, 06)

The Output Area displays the outgoing packets followed by the reply debug packets from the BrainStem module. 

Shutting Down

Close the aConsole application by first typing "exit" in the Input Area.  Then, unplug the power to power down the BrainStem module. 

brainstem> exit

What's Next

Check out the Getting Started Section for a complete list of resources to guide you through the BrainStem architecture. 

Revision History:

  • 2009-11-23: Updated documentation to match the aConsole software distribution.

BrainStem
Resources

 

Related Links:

aConsole Application tool information

Steep Compiler for TEA Programming

voice: 720-564-0373, email: sales@acroname.com, address: 4822 Sterling Dr., Boulder CO, 80301-2350, privacy
© Copyright 1994-2012 Acroname, Inc., Boulder, Colorado. All rights reserved.