| BrainStem GP Application - Getting Started |
Last Modified: 2008-01-29
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.
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".
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:
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).
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.
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.
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.
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.
To shut down, first close the GP Application by clicking the close window box in the title bar of the window.
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.
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.
| voice: 720-564-0373, email: firstname.lastname@example.org, address: 4822 Sterling Dr., Boulder CO, 80301-2350, privacy |
© Copyright 1994-2012 Acroname, Inc., Boulder, Colorado. All rights reserved.