BrainStem GP Application - Getting Started
Last Modified: 2008-01-29
find:

basket

Acroname Robotics PDF webpage version BrainStem GP Application - Getting Started PDF

Related
Products

Product image for Brainstem GP 1.0 Module
Brainstem GP 1.0 Module
Product image for USB-Serial Interface Conn V2.0
USB-Serial Interface Conn V2.0
Product image for Serial Interface Connector
Serial Interface Connector

Contents

Before You Begin

To use the GP application with your BrainStem module, you need the interface cable appropriate for your host computer platform.  More information about specific interface cables are available through the Related Products links, left. 

The GP Application

The GP Application gives you a quick, easy to use interface for checking your GP module's inputs and outputs.  Use the GP Application to check inputs, diagnose problems, adjust settings, and test creations built around the module. 

We will be using the GP Application extensively in this tutorial to explore the workings of the GP Module's hardware.  Programming the module is explored in other Getting Started Guides, including the guides for TEA and the Console Application. 

Downloading and Installing the Application

Log in to the Acroname Download Center .  Select the GP 1.0 program for your platform, then select download.  Depending on your platform, the software archive may automatically decompress.  If not, download the software into a temporary location and extract the files.  If you have other BrainStem software already in place, put the GP Application and support files in the same location. 

Tip

Need some additional information for your platform? Refer to the specific instructions:

MacOS - PalmOS - WinCE - Windows.  

Launch the GP application.  The GP application is located in the aBinary directory under the BrainStem main directory.  except with the PalmOS version.  If you are using PalmOS, you need to install the GP application and two support libraries (GP.prc, aIO.pdb, and aStem.pdb). 

The user interface for each platform is very similar so the descriptions of use below are the same regardless of platform.  When launched, the GP application opens with the Analog pane selected. 

In addition, the GP program automatically detects whether you have a GP 1.0 module or a GP 2.0 module attached.  The program will indicate which type of module was detected, and the program will display an additional IR options tab in the case of the GP 2.0.  All other tabs are identical for the two controllers. 


Windows XP, Palm OS, and Mac OS X versions of GP

Working with the BrainStem Module

Plug the host side of the interface cable into your host computer.  If your host computer has more than one serial port, determine which serial port you are using.  If you are not using a default port then you will need to adjust the configuration file "gp.config". 

Note

For MacOS, using a serial to USB adapter, you will need to edit the config file that will tell the application which USB hub you are plugged into.  To find the port, you may use 'ls /dev'.  On the PC, the COM1 port is the default. 

The BrainStem Resources center also contains a step-by-step tutorial on setting up a USB adapter for Windows and Mac systems. 

Plug the stem side of the interface cable into the BrainStem board.  Take care to observe the correct orientation when connecting the serial cable to the BrainStem module.  The serial port on the BrainStem is a single row of 4 conductors. 


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

Power up the module.  Refer to the GP module description for power supply requirements and considerations.  Take care to get the orientation right when plugging in the power to the module. 

Several things occur:

  • The red power LED on the BrainStem module indicates that the board has power. 
  • The red LED on the interface cable's BrainStem side 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. 
  • The green heartbeat LED on the BrainStem blinks to indicate the link between the BrainStem module and the host computer is configured correctly. 
  • The green LED on the GP program blinks in unison with the heartbeat on the BrainStem board, indicating that the link is passing data back and forth successfully. 

GP Application Feature: Analog Inputs

In the GP application, select the Analog tab.  Bars display the current voltage on each A/D input.  When the bar is shortest (farthest to the left), the input is at or near zero volts.  When the bar is longest (farthest to the right), the input is near the input voltage to the board or 5V, whichever is less. 


Windows XP version showing the Analog Pane

The BrainStem GP 1.0 module has 5 A/D inputs that each offer 10 bits of resolution.  When these inputs are not connected, the neighboring pins or even your hand touching an input pin can change the value.  Try touching the analog header with your finger.  The bars jump as the readings change. 

GP Application Feature: Digital I/O

Select the Digital tab.  The GP module has five digital ports.  These ports show the current mode of each I/O pin. 


Mac OS X version showing the Digital pane

The digital I/O pins on the GP 1.0 module can be used as inputs or outputs.  Four of the pins can be used as timers.  All pins are configured as inputs by default.  The pop-up menu after each pin label enables you to change the mode. 

The GP application polls the logic value present on each pin.  When a pin is set as input, the corresponding radio button shows the voltage on the pin.  When a pin is set as output, the radio button enables you to set the pin as on (1) or off (0). 

Tip

Take care when configuring the modes for the digital I/O pins.  The pins drive a maximum of 20 mA of current and can short out if the pin is configured as an output and tied directly to ground or Vcc. 

You can configure four of the pins as pulse measurement pins.  The GP 1.0 application uses this feature to measure the duration of the high pulse on a pulsed pin.  This can be directly tied to an RC receiver to get a reading from the current PWM output from the reciever.  You could take this value from an RC controller and mix or modify the value and then send it along to RC servos or other outputs

GP Application Feature: Servo Outputs

The GP modules have four high-resolution servo outputs for use with servo motors, gyros, speed controllers, and other related devices.  Select the Servo tab of the GP program to begin working with the servos. 

Most servos can be used with the BrainStem module.  The board has small numbers marking the servo outputs.  Plug a servo into one of the servo outputs.  The servo connector on the GP Module has three rows of four pins.  Servos are connected vertically, as shown below.  Most servos have a dark (usually brown or black) wire, a middle wire, and light-colored wire.  The dark wire is the ground wire for the servo; connect the ground wire to the bottom row of pins.  The middle wire is for servo power; connect it to the middle row of pins.  The lightest wire is for the positioning signal; connect it to the top row of pins. 


Some typical servo wiring schemes and their meaning.
Note

Servo power is provided through a two- or three-pin header (depending on type of module) next to the status LEDs.  Servo power can be supplied separately, or servo and logic power can come from the same source by using a shorting jumper.  The BrainStem Reference shows various power options by clicking on Hardware and then selecting the GP 1.0 or 2.0 module. 


Detail showing servo connection. Notice the vertical alignment.

After you plug in a servo, it positions itself and then remains still.  Move the corresponding slider in the GP application with your mouse.  The servo moves in unison with the slider. 

Tip

If a modified servo moves after you plug it in, you need to center it.  On the Servo tab, set the slider to position 128.  Select Config and slide the Offset setting until the servo stops moving.  Select Done, then Save Settings to EEPROM. 

Each servo output has several settings that you can use to modify its operation.  Click the Config button for the servo you were just moving.  A small dialog box appears with several controls for adjusting the settings of the selected servo output. 


Dialog box for servo configuration in Windows and Mac.
  • Enabled - Enables or disables the servo output. 
  • Reverse - Reverses the position of the servo within its range.  Click this and notice how the servo switches position. 
  • Speed - Sets the speed that the servo uses when moving to a new position.  A setting of 0 (zero) moves the servo at its maximum speed.  Any other setting (1-15) controls the speed of servo movement.  A speed of 1 is the slowest speed; 15 is close to the maximum servo speed.  The servo speed ramps up when a servo motion begins and ramps down as it completes.  Using the speed feature can smooth jerky servo motions.  Try several settings and move the servo to notice the different speeds.  Click done to go back to the main menu to reposition the servo after changing the speed setting. 
  • Offset - Sets the beginning position of the servo's range (similar to trim controls on RC transmitters).  Adjust this and notice how the servo moves to adjust to the new offset. 
  • Range - Sets the range that the servo travels between its minimum (0, zero) and maximum (255) positions.  Regardless of the size of the range, the servo always has a full 256-step resolution within that range. 

To save the new settings, select Done in the configuration dialog box, and then Commit Settings to EEPROM.  These will be the initial servo settings the next time the board is powered up. 

Shutting Down

To shut down, first close the GP Application by clicking the close window box in the title bar of the window. 

Tip

In PalmOS, you can switch to another application, such as the memo pad, to shut down. 

With WinCE, tap the power (red) LED indicator in the upper-right corner of the window to shut down. 

To shut off power to the GP 1.0 module, simply unplug the power.  The GP 2.0 has an onboard power switch that you can use instead.  Note that unplugging the power and flipping the switch won't shut off servo power if you are using a separate servo power source. 

What's Next

Check out the Getting Started section for a complete list of resources to guide you through the BrainStem architecture.  Click 'Starting' on the BrainStem Resources menu at the top of this page. 

To learn more about the BrainStem GP 1.0 and 2.0 pins and hardware, check out the BrainStem Reference

The GP Application is written in C and uses the aIO and aStem shared libraries for communication with the BrainStem GP module.  The source for the application is available as a download from the Acroname site.  You can use these libraries as a starting point for your own BrainStem application software. 

Revision History:

  • 2008-01-29: Changed Directory and updated article for GP 2.0

BrainStem
Resources

 

Related Links:

Tips on interfacing the BrainStem to a MacOS X USB hub

Brainstem Software: GP Overview

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