Resources »Pololu Wixel User's Guide
View document on multiple pages.
1. Overview
The Pololu Wixel is a general-purpose programmable module featuring a 2.4 GHz radio and USB. The Wixel is based around the CC2511F32 microcontroller from Texas Instruments, which has an integrated radio transceiver, 32 KB of flash memory, 4 KB of RAM, and a full-speed USB interface. A total of 15 general-purpose I/O lines are available, including 6 analog inputs, and the 0.1" pin spacing makes the Wixel easy to use with breadboards and perfboards.
We provide free, open-source apps for the Wixel that you can load and configure with its built-in USB bootloader, turning it into whatever you need for your current project. Simply download a different app to reuse the Wixel in your next project. Our Wireless Serial app turns a pair of Wixels into a wireless USB/TTL serial link for communication between two microcontrollers or between a PC and a microcontroller. This can be used, for example, for communication between two robots or to remotely monitor a robot from a computer. A special version of this app is designed for use with our Wixel shield for Arduino, which makes it easy to add wireless capabilities (including wireless programmability) to an Arduino or Arduino clone. Using an RF bit rate of 350 kbps, the serial app is capable of transmitting or receiving up to 10 KB of data per second and can reach a range of approximately 50 feet (under typical conditions indoors). Multiple serial links can be used simultaneously on different channels. Detailed information about the wireless serial app is available in Section 9.b. Our USB-to-Serial app turns a single Wixel into a USB-to-TTL serial adapter that is capable of baud rates as high as 350,000 bps and supports four serial control signals. This app does not use the radio. Detailed information about this app is available in Section 9.c. Our I/O Repeater app allows you to wirelessly extend the reach of your microcontroller’s I/O lines up to 50 feet using two or more Wixels. Detailed information about this app is available in Section 9.d. We plan to release additional apps in the future for wireless AVR programming, wireless sensing, and more. You can also write your own apps using the open-source Wixel SDK (see Section 10) and share them with the community. Included HardwareThe Wixel is available in two versions: The Partial Kit version comes with a 25×1 straight 0.1" male header strip. This version is ideal for compact installations and allows flexibility in choice of connectors. The Assembled version comes with its header pins soldered in, so it is ready to be connected to your project with no soldering required.
1.a. Module Pinout and Components
The Wixel can connect to a computer’s USB port via a USB A to Mini-B cable or a USB A to Mini-B adapter (not included). The USB connection is used to configure the Wixel and also to transmit and receive data. The USB connection can also provide power to the Wixel. On the side of the board opposite the USB connector, the Wixel has a 2.4 GHz PCB trace antenna. This antenna, along with the other RF circuitry, forms a radio that allows the Wixel to send and receive data packets in the 2.4 GHz band. The Wixel is based on the CC2511F32 microcontroller from Texas Instruments, which makes it compatible with the CC2500 transceiver, the CC2510Fx family, and the CC2511Fx family of chips from Texas Instruments. The Wixel’s radio is not compatible with Wi-Fi, Zigbee, or Bluetooth. The antenna is a “meandered Inverted F” design that is described in Texas Instrument’s application note AN043.
The three GND pins are all connected and are at 0 V by definition. When connecting the Wixel to other electronic systems, you should make sure that the Wixel’s GND is connected to the other system’s GND unless you are doing something very advanced. The Wixel can be powered from VIN pin. Simply connect a 2.7–6.5 V power source between VIN and GND, with the positive terminal going to VIN. It is OK to connect VIN and USB at the same time. See Section 5.a for more information about powering your Wixels. The VALT pin is connected to three things: the 5V USB bus power from the USB port (through a diode), VIN (through a diode), and to the input of the Wixel’s on-board 3.3 V regulator. The connection to 5V is switched off when a power supply is connected to VIN. Most people will not need to use the VALT pin: see Section 5.a for example uses. The pin labeled 3V3 on the board (3.3V Output in the diagram above) is connected to the output of the Wixel’s 3.3V regulator. This power source can be used to power other low-current peripherals in your system. With an input voltage of 5 V (either from USB, VIN, or VALT), this output can provide up to 150 mA of current. At higher input voltages, this output can provide up to 100 mA. The pin labeled RST on the board (RESET in the diagram above) is the reset line of the microcontroller. This pin can be driven low to perform a hard reset of the Wixel’s microcontroller. This should not be necessary for typical users, but it can be useful while you are developing a Wixel application (see Section 5.c). This pin is internally pulled high to 3.3 V, so it is okay to leave it unconnected. If you do wire something to this pin, the CC2511F32 datasheet recommends adding an external RC filter with values of 1 nF and 2.7 kΩ close to the pin in order to avoid unintended reset of the microcontroller. The Wixel has 15 free I/O lines whose behavior depends on the application that is loaded onto the Wixel. Specifically, these are all of the pins on Port 0 (P0_0 through P0_5), all of the pins on Port 1 (P1_0 through P1_7), and P2_1. The P2_1 pin is tied to the red LED but the other 14 free I/O lines are only connected to the microcontroller. The P2_2 line is also accessible, but it is tied to the yellow LED and is used to get the Wixel into bootloader mode (see Section 5.c). The amount of current that can be supplied by the CC2511F32’s I/O pins is not well-documented by the manufacturer. According to this forum post by a TI Employee, regular I/O pins are designed to be able to source 4 mA while P1_0 and P1_1 are designed for 20 mA. Caution: The Wixel’s I/O lines are not 5V tolerant. You must use level-shifters, diodes, or voltage dividers to connect the Wixel to outputs from 5V systems. The CC2511F32 has several peripherals that are available to be used in Wixel applications:
Different Wixel applications may use different sets of these peripherals. Consult the application documentation for details on the behavior of the I/O lines. The pinout and peripheral diagram at the top of this section is also available as a printable pdf (145k pdf).
The Wixel has three indicator LEDs: Green USB LEDThe green LED is powered from USB, so it can only be turned on when USB cable is connected and supplying power to the Wixel. While the Wixel is in bootloader mode (i.e. the app is stopped), this LED is used to indicate the USB status of the device. When the Wixel USB Bootloader connects to USB, the green LED starts blinking slowly. The blinking continues until the bootloader receives a particular message from the computer indicating that the Wixel USB Bootloader drivers are installed correctly (see Section 3.a for driver installation instructions). After the bootloader gets this message, the green LED will do a double-blinking pattern. The green LED also turns off during USB Suspend Mode, which happens when the computer goes to sleep or shuts down the USB port for any other reason. While the Wixel is running its app, the behavior of the LED depends on the app. The standard apps provided by Pololu all behave as follows: When the app connects to USB, the green LED starts blinking slowly. The blinking continues until the app receives a particular message from the computer indicating that the app’s drivers are installed correctly. After the app gets this message, the green LED turns solidly on. The green LED also turns off during USB Suspend Mode, which happens when the computer goes to sleep or shuts down the USB port for any other reason. Red LEDWhile the Wixel is in bootloader mode (i.e. the app is stopped), this LED indicates whether there is an application on the Wixel. If there is no application, the red LED will be on. Otherwise, it will be off. By default, the Wixel does not have an application on it, so this LED will be on the first time you power your Wixel. The P2_1 pin is connected to the red LED, so this line will go high when the red LED is on and otherwise be pulled low. While the Wixel is running its app, the behavior of this LED depends on the app. See the documentation of your particular app for more details. Yellow LEDWhile the Wixel is in bootloader mode (i.e. the app is stopped), this LED turns solidly on and flickers whenever the bootloader receives a command from Wixel software on the computer. The Wixel Configuration Utility queries the state of the bootloader once per second, so if the Wixel Configuration Utility is open then the LED will flicker once per second. While the Wixel is being programmed, the yellow LED will constantly flicker. The P2_2 pin is connected to the yellow LED, so this line will go high when the yellow LED is on and otherwise be pulled low. While the Wixel is running its app, the behavior of this LED depends on the app. See the documentation of your particular app for more details. 1.b. Supported Operating SystemsThe Wixel USB drivers and configuration software currently work under Windows 8, Windows 7, Windows Vista, Microsoft Windows XP (SP 3), Linux, and Mac OS X. Any Wixel app that implements a single USB virtual COM port will work on Linux or Mac OS X with no special driver installation required. Any Wixel app that implements a Human Interface Device (HID) will work on Windows, Linux, or Mac OS X with no special driver installation required. Mac OS X compatibility: we have confirmed that the Wixel works on Mac OS X 10.7 and we can assist with advanced technical issues, but most of our tech support staff does not use Macs, so basic support for Mac OS X is limited. 1.c. Government Regulations for Radio DevicesWarning about radio regulations: The Wixel has not been tested or certified for conformance with any radio regulations, and the Wixel is shipped with only a bootloader that does not use the radio. The 2.4 GHz band is relatively unrestricted in many parts of the world, but it is your responsibility to comply with your local regulations if you program your Wixel to use its wireless capabilities. The Wixel is a multi-purpose development platform, not a finished product, and it is not certified by the FCC or any other government agency. It is your responsibility to follow local regulations and use good engineering practices when developing, installing, and configuring apps for your Wixel. The Wixel has a low-power radio and uses the reference PCB antenna suggested by TI, so we expect typical applications developed for the Wixel to comply with FCC rules, but the Wixel is not intended for integration into other products. If you are contemplating adding Wixel-like features to your product, we recommend that you integrate the CC2511 IC directly using documentation from TI; any software developed for the Wixel should work on any other CC2511-based platform. For more information on the requirements for operating a 2.4 GHz device, see TI Application Note 032: SRD regulations for license-free transceiver operation in the 2.4 GHz band. 2. Contacting Pololu
We would be delighted to hear from you about any of your projects and about your experience with the Wixel. You can contact us directly or post on our forum. Tell us what we did well, what we could improve, what you would like to see in the future, or anything else you would like to say! 3. Getting Started3.a. Installing Windows Drivers and SoftwareBefore you connect a Wixel to a computer running Microsoft Windows, you should install the drivers:
Windows 8, Windows 7, and Windows Vista users: Your computer should now automatically install the necessary drivers when you connect a Wixel. No further action from you is required. Windows XP users: Follow steps 5–9 for each new Wixel you connect to your computer. You will also have to follow these steps again the first time you run an actual Wixel app on the Wixel.
After installing the drivers, if you go to your computer’s Device Manager and expand the “Pololu USB Devices” list, you should see an entry for the Pololu Wixel USB Bootloader.
If you see the “Pololu Wixel USB Bootloader” entry in your device manager, it means that your Wixel is in bootloader mode. Your Wixel should go into bootloader mode when you first plug it into USB, because there is no app on the Wixel by default. Once you have loaded an app onto the Wixel using the Wixel Configuration Utility, and the app is running, then you will not see the Pololu Wixel USB Bootloader entry in your Device Manager. The entry you see in the Device Manager will depend on the application that is loaded on the Wixel. Some apps might not enable the USB interface, in which case you will see no entry for the Wixel in the Device Manager. However, typical Wixel Apps will appear in your Device Manager as a single Virtual COM port (with product ID 0x2200) in the “Ports (COM & LPT)” list as shown below:
In parentheses, you will see the name of the port (for example, COM5 or COM6). Some software will not allow connection to higher COM port numbers. If you need to change the COM port number assigned to a Wixel, you can do so using the Device Manager. Bring up the properties dialog for the COM port and click the “Advanced…” button in the “Port Settings” tab. From this dialog you can change the COM port assigned to your device. Windows will remember which COM port was assigned to which Wixel using the built-in serial number of the Wixel; a given Wixel will always get assigned to the same COM port regardless of which USB port it is plugged into. 3.b. Installing Linux Drivers and Software
You can download the Wixel Configuration Utility and the Wixel command-line utility (wixelcmd) for Linux here:
Unzip the tar/gzip archive by running “tar -xzvf” followed by the name of the file. After following the instructions in Any Wixel app that implements a USB virtual COM port or a Human Interface Device (HID) will work on Linux with no special driver installation required. The virtual COM ports are managed by the cdc-acm kernel module, whose source code you can find in your kernel’s source code in 3.c. Installing Mac OS X Drivers and SoftwareMac OS X compatibility: we have confirmed that the Wixel works on Mac OS X 10.7 and we can assist with advanced technical issues, but most of our tech support staff does not use Macs, so basic support for Mac OS X is limited.
You can download the Wixel Configuration Utility and the Wixel command-line utility (wixelcmd) for Mac OS X here:
Double click on the dmg file to open it, and then follow the instructions in The virtual COM ports are managed by the AppleUSBCDCACM component of Mac OS X. The source code of AppleUSBCDCACM is available from Apple. When you connect a Wixel running an app that implements a virtual serial port to the PC, the virtual serial port should appear as a device with a name like 3.d. Loading an Example AppWhen you first get your Wixel it will have no application loaded. To make your Wixel do something useful, you must load an app onto it. This section guides you through the steps needed to load an example application onto the Wixel using the Wixel Configuration Utility.
After completing this tutorial you should be comfortable with writing apps to the Wixel and reading back the settings. This is all you need to know in order to configure your Wixels. When you load a real application, such as the Wireless Serial App, the only thing that will be different are the names and meanings of the parameters. To understand what the different parameters mean, refer to the documentation for your specific app. Some apps might implement a non-standard USB interface (or no USB interface at all). In that case, they will not be recognized by the Wixel Configuration Utility while the app is running, so you will need to get them into bootloader mode manually (see Section 5.c and also the app’s documentation). 4. Configuring Your WixelsThe Wixel Configuration Utility allows you to write and read settings from the Wixel. This section explains all of the features of the Wixel Configuration Utility in detail.
WixelsOn the left side of the window, in the Wixels box, you can see a list of all the Wixels connected to the computer that are recognized by the Wixel Configuration Utility. The Wixel Configuration Utility should recognize any Wixel that is in bootloader mode (i.e. the app is stopped) or is running an app that implements a single USB Virtual COM port with a USB Vendor ID of 0x1FFB (for Pololu) and a Product ID of 0x2200. If your Wixel is connected to your computer, but does not show up in the Wixel Configuration Utility, then your drivers might not be installed properly, or the Wixel might be running an application that uses a different type of USB interface or doesn’t use USB at all. If you have trouble getting the Wixel Configuration Utility to recognize your Wixel, then see Section 10 for help. The text displayed in the Wixel list (e.g. “07-C2-C8-3A”) is the serial number of your Wixel. Each Wixel has a unique 32-bit serial number which was randomly generated and assigned to it when the Wixel was manufactured. The icon displayed in the Wixel list represents the current state of the Wixel. Each Wixel will be in one of these states:
If you select a Wixel, you can see more information about it in the area below the list. The USB Product ID is the current product ID presented by the Wixel on its USB interface, as defined in the USB Specification. The Port Name is the name of the virtual COM port that has been assigned to the Wixel. In Windows, the Port Name is also available in the Device Manager. The Stop App button stops the application that is running on the currently-selected Wixel, putting that Wixel into bootloader mode. The Start App button takes the Wixel out of bootloader mode to run the application that is currently on it. App ConfigurationOn the right side of the window, in the App Configuration box, you can see the name of the currently-open app and the current settings. You can open a different app by clicking the “Open…” button. In Windows, you can also open an app simply by double-clicking on it. The Wixel Configuration Utility can open app files in either the WXL format (documented in Section 9.d) or the standard Intel HEX format. You can change the current settings by double-clicking on a value and typing a new value in. The parameters that are available depend on the app that is open; different apps have different parameters available. Please see the documentation for your specific application for an explanation of what the parameters mean, and what the valid values are. The Wixel Configuration Utility will not prevent you from entering invalid or inconsistent values. Writing to a WixelAfter you have chosen the app and settings you want to use, and selected a Wixel, you can write the app and settings to the Wixel by clicking the Write to Wixel button. This will erase whatever application was previously on the Wixel and write the new application to the Wixel. When the write operation is done, the Wixel will be restarted and the application should start running. Reading from a WixelTo read the settings from a Wixel that has been programmed, select the Wixel. If the Auto Read checkbox is checked, then the Wixel will automatically be read. Uncheck this box if you want to retain current settings when changing Wixels (for example, when you want to write the same app and settings to multiple Wixels). If the box is unchecked, you can click the Read Wixel button at any time to read settings from the selected Wixel. To read the settings from a Wixel, you will need to open the app that is currently on the Wixel. This is necessary because the app file contains metadata which is needed in order to correctly interpret the settings contained in the Wixel’s flash memory. If you have lost the app file and want to read the contents of your Wixel, select Read Flash and Export to HEX File… from the Wixel menu. You can then open the exported HEX File as an App and use it to program other Wixels. The settings from the Wixel will be contained in the exported HEX file but you will not be able to read these settings in the Wixel Configuration Utility. If the Wixel’s application is running when the read operation starts, the Wixel Configuration Utility will temporarily stop the application and put the Wixel into bootloader mode in order to read its contents. When the read operation is completed, the Wixel Configuration Utility will restart the app. Other CommandsThe Erase Wixel command (found in the Wixel menu) erases the app from the currently selected Wixel (every bit in the application flash section becomes a 1). The Verify Wixel command reads the currently selected Wixel and tells you whether its contents are identical to the app and settings displayed on the right in the App Configuration box. 5. Connecting Your WixelsThis chapter explains some of the electrical connections you might need to make to get your Wixel working the way you want it to. 5.a. Connecting PowerThe two main ways of powering the Wixel are the USB port and the VIN pin. The schematic of the Wixel’s power system is shown below:
VIN Power InputThe Wixel can be powered from VIN if you connect a 2.7–6.5 V power supply (e.g. battery or regulator) to the GND and VIN pins. The negative terminal should be connected to GND. The positive terminal should be connected to VIN. It is okay to have both USB and VIN connected at the same time.
USB Power InputThe Wixel can be powered from USB if you connect a USB cable and leave VIN disconnected. The Wixel will draw its power from USB if VIN is disconnected or it is below about 4 V.
3V3 Power OutputThe Wixel’s 3V3 pin gives access to the output of the Wixel’s 3.3 V regulator. If the Wixel’s power supply drops below approximately 3.5 V, the 3V3 output will be less than 3.3 V. Normally this output can provide up to 150 mA, but if the Wixel’s power supply is above 5 V then it is limited to 100 mA. You can use 3V3 to power your own 3.3 V devices. VALT Power OutputVALT provides access to the input pin of the Wixel’s 3.3 V regulator, which is connected through a diode to VIN or to the USB bus voltage, depending on which power source is connected. You can use VALT to power your own circuits as long as you do not draw more than about 500 mA. For example, if you leave VIN disconnected, VALT can power 5V devices. Low Power ConsiderationsThe CC2511F32 is capable of a sleep mode (PM2) where the chip draws less than 1 μA and is still capable of waking itself up. Without modifying the Wixel’s hardware, it is possible to power it from VIN and get the current consumption down to around 100 μA. Most of that current is consumed by the Wixel’s 3.3 V regulator. To get rid of it, you will need to sever the output pin of the regulator and power the Wixel directly from the 3V3 pin with a 2.0–3.6 V power supply. For details on how to do this, please contact Pololu. Please note that currently none of the Wixel apps support low power modes, so the Wixel will draw approximately 30 mA at all times. To make your Wixel operate with low power you would have to write your own app or modify one of the existing apps. You will need to make sure that all of the I/O lines are either outputs or get pulled high or low: an input line at an intermediate voltage can consume several microamps of extra current. 5.b. Connecting a Microcontroller via TTL SerialIf you have loaded a Wixel app that employs one of the Wixel’s two UARTs (such as the Wireless Serial App), then the Wixel can communicate with another microcontroller via asynchronous, non-inverted TTL serial. Communication between the Wixel and an RS-232 device requires additional hardware.
To connect your microcontroller to a Wixel for serial communication, make these connections:
Please refer to the documentation of your specific Wixel app to determine the location of the TX pin(s) and RX pin(s). Note: The Wixel does not support the RS-232 voltage levels typically used by DB9 serial ports. The Wixel’s I/O lines, including the RX and TX lines, operate on voltages between 0 and 3.3 V are not 5 V tolerant. To connect the Wixel to an RS-232 serial signal, you will need additional level-shifting and inverting hardware like the Pololu 23201a serial adapter (RS-232 serial is inverted; the Wixel’s serial interface expects non-inverted serial). 5.c. Connecting Buttons and Starting the BootloaderIn order to load a new app or new settings onto your Wixel (or read the Wixel’s flash memory) you will need to get it into bootloader mode. Most Wixel apps support a special USB command for putting the Wixel into bootloader mode and the Wixel Configuration Utility can send that command automatically when you try to access the Wixel’s flash. However you might find yourself in a situation where that method will not work. This can happen for two reasons:
No matter what state the Wixel is in, you can manually get it into bootloader mode by connecting USB, setting P2_2 high, and resetting the Wixel. There are two main ways to accomplish this. One way is to disconnect the Wixel from any possible power sources, connect P2_2 to 3V3 using a wire, and then plug it into USB.
Another way to is to wire a bootloader button and a reset button to the Wixel and follow the procedure shown in the picture below:
6. Using a Virtual COM PortMost of the available Wixel apps implement a USB interface that consists of a single virtual COM (serial) port. This interface allows you to send and receive bytes from the Wixel in the same way you would send and receive bytes from any other serial port on your computer. 6.a. Determining the Port NameTo connect to a COM port, you usually have to know the name of the port. In Windows, the port name will be something like “COM4” and you can determine the port name by selecting the Wixel in the Wixel Configuration Utility and looking at the “Port Name” property displayed below. You can also find out the port name by looking the “Ports (COM & LPT)” list in your Device Manager. Windows Tip: Besides having names like “COM5” and “COM6”, the virtual COM ports provided by the Wixel also have names like “\\.\USBSER000” and “\\.\USBSER001”. These names are assigned sequentially whenever a device with a virtual COM port is plugged in. If you only have one device with a virtual COM port plugged into your computer, the name “\\.\USBSER000” will usually be assigned to it. These names will work with most programs that allow you to specify arbitrary port names. 6.b. Using a Terminal ProgramThere are many free terminal programs available which are capable of sending and receiving bytes on a virtual COM port. These programs include PuTTY (Windows or Linux), Tera Term (Windows), and Br@y Terminal (Windows). Advanced users developing scripted applications may prefer the free terminal program kermit. To use any of these terminal programs with the Wixel, you must specify the port name (see Section 6.a) and the baud rate. The baud rate may or may not affect anything; see your application’s documentation. The characters you type will be transmitted on the programmer’s TX line. Bytes received by the programmer on the RX line will be displayed on the screen by the terminal program. Typical terminal programs will allow you to choose several other settings besides the baud rate. If you are not sure what settings to use, then you should pick 8 data bits, 1 stop bit, no parity, and no flow control. Typical terminal programs will not allow you to use the serial control signals, but Br@y terminal does. You can click the “DTR” and “RTS” buttons to change the state of the DTR and RTS signals. The state of the CTS, CD, DSR, RI, DTR, and RTS signals are indicated by the colors of the corresponding buttons.
If you need to send and receive non-ASCII bytes, you can use the Pololu Serial Transmitter Utility for Windows or Br@y Terminal. 6.c. Writing PC Software to Use a Serial PortYou can write your own computer program that communicates with a serial port. The freely available Microsoft .NET framework contains a SerialPort class that makes it easy to read and write bytes from a serial port. Here is some example C# .NET code that uses a serial port:
// Choose the port name and the baud rate.
System.IO.Ports.SerialPort port = new System.IO.Ports.SerialPort("COM4", 115200);
// Connect to the port.
port.Open();
// Transmit two bytes on the TX line: 1, 2
port.Write(new byte[]{1, 2}, 0, 2);
// Wait for a byte to be received on the RX line.
int response = port.ReadByte();
// Show the user what byte was received.
MessageBox.Show("Received byte: " + response);
// Disconnect from the port so that other programs can use it.
port.Close();
7. Ensuring a Good Radio SignalHere are some tips for improving the quality of the radio signals sent between a pair of Wixels:
8. Schematic DiagramThe schematic diagram of the Wixel is shown below:
The schematic also available as a printable pdf (51k pdf). 9. Wixel AppsThis section describes the available Wixel apps. 9.a. Example App: Blink LEDThis is an example app that blinks the red LED with a configurable period. See Section 3.d for a tutorial on using this app. Download link: example_bink_led_v1.0.wxl (11k wxl) 9.b. Wireless Serial App
OverviewThis app allows you to connect two Wixels together to make a wireless, bidirectional, lossless serial link. It uses an RF bit rate of 350 kbps, is capable of carrying up to 10 KB of payload data per second, and can reach a range of approximately 50 feet (under typical conditions indoors). You can also use it to turn one Wixel into a USB-to-TTL serial adapter. This app can run on multiple pairs of Wixels as long as each pair operates on a different radio channel (the channels should be separated by 2 to avoid interference). This app is designed for pairs of Wixels; it will not work properly if three or more Wixels are broadcasting on the same radio channel. Installation InstructionsDownload Wireless Serial App v1.3 (26k wxl). Open it with the Wixel Configuration Utility, choose your parameters, and then write it to two Wixels. See Section 4 for more information on how this is done. Default Pinout
DescriptionThis device appears to the USB host as a Virtual COM Port (with USB product ID 0x2200). If you are using Windows, you should see an entry labeled “Wixel” in your Device Manager in the “Ports (COM & LPT)” category while the app is running. There are three basic serial modes that can be selected:
You can select which serial mode you want to use by setting the serial_mode parameter to the appropriate number (from the list above) or you can leave the serial mode at 0 (which is the default). If the serial_mode is 0, then the Wixel will automatically choose a serial mode based on how it is being powered as described in the table below, and it will switch between the different serial modes on the fly.
The RX pin has an internal 20 kΩ pull-up resistor. The PA_PD pin (P1_5) is a debugging output that goes low while the Wixel is transmitting a packet on the radio. The serial data format used by this app is 8 data bits, one stop bit, with no parity, which is often expressed 8-N-1. The data is non-inverted, so 0 V represents 0 and 3.3 V represents 1. Indicator LEDsThe green LED behaves as described in Section 1.a, and also flickers when there is data transferred over USB. The yellow LED represents the state of the radio. If the Wixel is in a serial mode where the radio is not used, the yellow LED will be off. Otherwise, the yellow LED turns on and off slowly until radio communication is established for the first time, after which it blinks briefly once per second and flickers whenever data is sent or received via the radio. The red LED indicates errors. The red LED will flash briefly if a byte is received on the UART’s RX line that had to be discarded because the receive buffers were full. The red LED will turn on when a framing error occurs on the RX line and will stay on until the RX line goes high. Control SignalsIn addition to relaying bidirectional serial data, this app also relays the values of four control signals: DTR, RTS, DSR, and CD. The names of these control signals come from the RS-232 protocol, but in this app they do not actually have the same role as they have in that protocol: they are general purpose digital control signals that can carry any kind of data that you want them to, as long as that data changes slowly (on the order of 5 Hz or slower) and is limited to two bits in each direction. In USB-to-Radio mode, the DTR and RTS signals from USB are transmitted wirelessly to the other Wixel, while the control signals wirelessly received from the other Wixel are relayed to USB as DSR and CD. In UART-to-Radio mode, the DSR and CD signals from the digital input pins are transmitted wirelessly to the other Wixel, while the control signals wirelessly received from the other Wixel are relayed to the DTR and RTS output pins. In USB-to-UART mode, the DTR and RTS signals from USB are relayed to the corresponding output pins, while the values of the DSR and CD input pins are relayed to USB. If two Wixels are communicating wirelessly with each other and both are in UART-to-Radio mode or both are in USB-to-Radio mode, then the correspondence between the control lines is as follows: DSR on one Wixel corresponds to DTR on the other Wixel, while RTS on one Wixel corresponds to CD on the other Wixel. The default configuration of this app (as shown in the table above) gives the Wixel two inverted output pins (DTR and RTS), and two inverted input pins (DSR and CD). These pins are inverted, which means that a logical value of 0 corresponds to high voltage (usually 3.3 V), while a logical value of 1 corresponds to 0 V (GND). By changing the configuration parameters (see below), you can disable these signals, reassign them to different I/O lines, or add non-inverted inputs and outputs. Any pin configured as an input will have an internal 20 kΩ pull-up resistor unless it is assigned to P1_0 or P1_1, which do not have pull-up or pull-down resistors. You do not have to connect anything to the control signal pins in order to send and receive serial data. These pins are optional. General Parameters
Pin Assignment ParametersThe following parameters can be used to reassign the control signals to different pins on the Wixel. The value of each parameter must be the number of an unused pin on the Wixel. The number can be computed by multiplying the first digit in the pin name by 10 and adding it to the second digit in the pin name. For example, if you wanted to assign the DSR pin to P1_2, you would set nDSR_pin to 12. To disable a signal (assign it to no pin), set the corresponding parameter to -1.
You should not simultaneously enable the non-inverted and inverted input for the same signal. Specifically, either nCD_pin or CD_pin should be -1 and either nDSR_pin or DSR_pin should be -1. Example Uses
CaveatsData will be lost if the Wixel receives bytes on the RX line faster than the radio can convey them to the other Wixel. If you have trouble, try reducing the amount of data sent to the RX line by lowering the baud rate or adding delays to your microcontroller’s code. Caution: The Wixel’s I/O lines are not 5V tolerant. You must use level-shifters, diodes, or voltage dividers to connect the Wixel to outputs from 5V systems. Also, avoid drawing more current from an I/O line than it can provide (see the discussion of P1_0 and P1_1 in Section 1.a). Avoid connecting multiple output pins together. The Wixel does not support the RS-232 voltage levels typically used by DB9 serial ports. The Wixel’s I/O lines, including the RX and TX lines, operate on voltages between 0 and 3.3 V. To connect the Wixel to an RS-232 serial signal, you will need additional level-shifting and inverting hardware like the Pololu 23201a serial adapter (RS-232 serial is inverted; the Wixel’s serial interface expects non-inverted serial). Versions
Versions Configured for the Wixel Shield for ArduinoThese are special versions of the app that have the same code as the corresponding standard versions, but have different settings so that they will work well with the Wixel Shield for Arduino. The default baud_rate was changed to 115200, which is the baud rate used by the Arduino Uno’s bootloader. All the pin assignment parameters were set to -1 (disabled) except arduino_DTR_pin, which was left at 0 (P0_0). The framing_error_ms parameter was set to 5. The only parameters of these apps that can be modified by the user are the radio_channel parameter and baud_rate parameter. For more information about configuring this version, please see the Section 2.c of the Wixel Shield User’s Guide. 9.c. USB-to-Serial App
OverviewThis app allows you to turn a Wixel into a USB-to-TTL serial adapter capable of baud rates up to 350,000 bps. While this app does not use the radio, it has more features than the USB-to-UART mode of the Wireless Serial App (see Section 9.b). Installation InstructionsDownload USB-to-Serial App v1.0 (13k wxl). Open it with the Wixel Configuration Utility and write it to a Wixel. See Section 4 for more information on how this is done. Pinout
DescriptionAfter you have loaded this app onto a Wixel, the Wixel will appear to the computer as Virtual COM Port (with USB product ID 0x2200). If you are using Windows, you should see an entry labeled “Wixel” in your Device Manager in the “Ports (COM & LPT)” category while the app is running. You can connect to this COM port using a terminal program in order to send and receive data on the TX and RX lines. Typical terminal programs will allow you to set the baud rate, parity type, and number of stop bits. Some terminal programs will allow you to use the control signals (DTR, RTS, DSR, and CD). For more information, on how to use a virtual COM port, see Section 6. This app supports all integer baud rates between 23 and 350,000 bps. This app supports all the different types of parity: None, Odd, Even, Mark and Space. This app supports 1 stop bit or 2 stop bits mode. The RX line has an internal pull-up resistor, so you can leave this line disconnected. The DSR and CD input pins have internal pull-up resistors, so when they are disconnected they will read as high (logical 0). The DTR and RTS output pins are designed for high current (see the information on P1_0 and P1_1 in Section 1.a). The control signals are all inverted, which means that a logical 0 corresponds to a high voltage (3.3 V) and a logical 1 corresponds to a low voltage (0 V). This app will discard bytes received on the RX line that have framing errors or parity errors, and it will also throw out bytes if there is an RX buffer overrun. An RX buffer overrun should not happen if you are using a baud rate of 350,000 bps or less. Example Uses
Caveats
Caution: The Wixel’s I/O lines are not 5V tolerant. You must use level-shifters, diodes, or voltage dividers to connect the Wixel to outputs from 5V systems. Also, avoid drawing more current from an I/O line than it can provide (see the discussion of P1_0 and P1_1 in Section 1.a). Avoid connecting multiple output pins together. The Wixel does not support the RS-232 voltage levels typically used by DB9 serial ports. The Wixel’s I/O lines, including the RX and TX lines, operate on voltages between 0 and 3.3 V. To connect the Wixel to an RS-232 serial signal, you will need additional level-shifting and inverting hardware like the Pololu 23201a serial adapter (RS-232 serial is inverted; the Wixel’s serial interface expects non-inverted serial). 9.d. I/O Repeater App
OverviewThis app allows you to wirelessly extend the reach of your microcontroller’s I/O lines up to 50 feet using two or more Wixels. An input pin on one Wixel can be mapped to an output pin on another Wixel. When the input pin reads high, the output pin will be driven high (3.3 V) and when the input pin reads low, the output pin will be driven low (0 V). Each Wixel can have up to 15 input pins, 15 output pins, or a mixture of input and output pins. Each input pin can map to one or more output pins on one or more Wixels. Installation InstructionsDownload I/O Repeater App v1.3 (22k wxl). Open it with the Wixel Configuration Utility, choose your settings, and write it to two or more Wixels. See Section 4 for more information on how this is done. DescriptionThe following 15 pins on each Wixel can be used as inputs or outputs (or be disabled):
The behavior of each pin is determined by its link ID, which is a parameter that you can set individually for each pin on each Wixel using the Wixel Configuration Utility. A link ID of 0 means the pin will be disabled (it will be an input but its input value will not have any effect). A negative link ID between -1 and -127 means that the pin will be a digital input and its value will be transmitted over the radio. A positive link ID between 1 and 127 means that the pin will be a digital output and its output value will be determined by the input value of the pin with the opposite (negated) link ID on another Wixel. For example, if the P1_3 pin on one Wixel has a link ID of -13, then it will be a digital input and its value will be reflected on all the output pins that have a link ID of 13 on all the other Wixels. Input pins do not have any effect on output pins that are on the same Wixel. If a Wixel is running this app and has one or more pins configured to be inputs, then it will transmit a single radio packet every 7–10 ms that contains input values and link IDs of all of its inputs. Any other Wixel that successfully receives this packet will process it and use it to update the state of its output pins. This app will work with more than two Wixels on the same radio channel. In that case, make sure that you do not have multiple input pins on different Wixels with the same link ID: otherwise, the corresponding output pin(s) will change state unpredictably whenever there is a conflict between the different input pins. It is OK to have muliple output pins with the same link ID. Every pin configured as an input has an internal 20 kΩ pull-up resistor except P1_0 and P1_1, which float when they are inputs. This means that if you leave the input pin disconnected, it will be pulled high by default. Each output pin will drive low (0 V) by default before any radio packets are received that change its state. After you have loaded this app onto a Wixel, the Wixel will appear to the computer as Virtual COM Port (with USB product ID 0x2200). If you are using Windows, you should see an entry labeled “Wixel” in your Device Manager in the “Ports (COM & LPT)” category while this app is running. You can not send or receive data on this COM port. Its only purpose is to let the Wixel Configuration Utility easily get the Wixel into bootloader mode. Parameters
Default SettingsThe default settings are:
Therefore, if you load this app onto two Wixels using the default settings, they should behave as follows: If nothing is connected to either Wixel’s P0_0 line, the red LEDs on both Wixels will be on. If you connect the P0_0 line of one Wixel to GND using a wire, then you should see the red LED on the other Wixel turn off. This demonstrates the basic operation of the app. Example Uses
Caveats
Caution: The Wixel’s I/O lines are not 5V tolerant. You must use level-shifters, diodes, or voltage dividers to connect the Wixel to outputs from 5V systems. Also, avoid drawing more current from an I/O line than it can provide (see the discussion of P1_0 and P1_1 in Section 1.a). Avoid connecting multiple output pins together. Versions
9.e. ShiftBrite App
OverviewThis app allows you to wirelessly control a chain of one more ShiftBrite RGB LED modules at a distance of 50 feet or more from a PC. You will need two Wixels to set up the wireless link: one connected to the ShiftBrites, running the ShiftBrite app, and one connected to your PC with USB, running the Wireless Serial App (Section 9.b). Using a terminal or your own software, you can send a series of hex characters indicating the desired color for each module to the virtual COM port. The characters are transmitted wirelessly, received by the remote Wixel, decoded, and sent to the ShiftBrite chain, causing each module to light up with the specified color. Approximately 1000 color commands can be sent per second, allowing large displays or smooth animations. The ShiftBrite App is also compatible with the ShiftBar, which uses the same control electronics. Installation InstructionsFollow the instructions for the Wireless Serial App in Section 9.b to set up and test a basic wireless serial link between two Wixels, using the latest version of the Wireless Serial App. Download ShiftBrite App v1.1 (20k wxl). Open it with the Wixel Configuration Utility, choose your settings, and write it to one of the Wixels. See Section 4 for more information on how this is done. Connecting the Wixel to the ShiftBrite chainThe following connections should be made between the Wixel running the ShiftBrite App and the first ShiftBrite in the chain:
Additionally, the Wixel and ShiftBrites may share the same VIN as long as the voltage requirements for both modules are satisfied. For initial testing, you may alternatively use VALT to power the ShiftBrites from USB (see Section 5.a). Using the ShiftBrite AppAfter making the correct connections and applying power, open a terminal program and connect to the COM port created by the Wixel running the Wireless Serial App. Type To shift out multiple color commands at once, for example when you want to set the colors of the entire chain, type a series of single-color commands without pressing Enter, then press Enter once to apply them all. Parameters
Data FormatThe data consists of a series of red, green, and blue (RGB) values, as ASCII hex strings. Each value contains from 1 to 4 characters, depending on the value of input_bits, specifying a number from 0 to 2input_bits-1. When a complete set of R, G, and B values has been received, the values are multiplied or divided by the appropriate factor to match the 10-bit ShiftBrite data format and shifted out to the ShiftBrite chain. An Enter character (ASCII 10 or 13) causes the Latch pin to be toggled, instantly setting each ShiftBrite to its new color. Tips
Versions
9.f. Wireless Tilt Mouse App
OverviewThis app allows you to make a wireless tilt mouse for your computer. By tilting the mouse, you can control the position of the mouse cursor. The mouse also supports two buttons for clicking. This app requires two Wixels: a transmitter and a receiver. The transmitter Wixel detects a tilt using an accelerometer and wirelessly transmits that information to the receiver Wixel, which relays it to the computer as mouse movements. The receiver appears to the computer as a standard USB Human Interface Device (HID); after the Wixels have been configured, no driver installation is necessary to use the mouse. Parts NeededThere are many different ways to build this project. Here are the parts we used:
You will need wires and connectors to make the electrical connections. We suggest our jumper wire kits or premium jumper wires. You will need a soldering iron to solder the included header pins into the accelerometer. The pushbuttons are optional, and any normally-open (NO) pushbutton or switch will work. If you want to have both a left mouse button and a right mouse button you should get two pushbuttons. Note that only one button (on P1_2) is shown in the picture above. Pinout of Transmitter Wixel
Wixel ConfigurationDownload the Wireless Tilt Mouse App (26k wxl). Open it with the Wixel Configuration Utility, choose your settings, and write it to the transmitter Wixel. The transmitter Wixel should now appear to your computer as a USB virtual COM port (with USB product ID 0x2200). You can not send or receive data on this COM port. Its only purpose is to let the Wixel Configuration Utility easily get the transmitter Wixel into bootloader mode when the transmitter Wixel is connected to the computer via USB. Download the Wireless Tilt Mouse Receiver App (15k wxl). Open it with the Wixel Configuration Utility, choose your settings, and write it to the receiver Wixel. The receiver Wixel should now appear to your computer as a Human Interface Device. If you are using Windows there should be a new entry entitled “HID-compliant mouse” in your Device Manager in the “Mice and other pointing devices” section. The receiver will also show up as a keyboard, but it does not use that interface. The Wixel Configuration Utility does not yet detect Wixels with USB HID interfaces. Therefore, if you need to reconfigure your receiver Wixel, you will need to manually get it into bootloader mode (set pin P2_2 high and reset – although this app monitors P2_2 all the time so the reset is not strictly necessary). AssemblyWith the battery pack switched off, connect power for the transmitter Wixel. The black wire from the battery pack should connect to a GND pin on the Wixel. The red wire from the battery pack should connect to VIN. To test the connection, turn on the battery pack: the transmitter Wixel’s yellow LED should turn on. Remember to turn off the battery pack while you are making connections. Connect the GND of the Wixel to the GND (ground) pin of the accelerometer. Connect power for the accelerometer. The MMA7361L accelerometer we used can run off of 3.3 V and draws relatively little current, so we powered it from the Wixel’s 3V3 line by connecting 3V3 to the accelerometer’s VDD. Make any connections necessary to enable your accelerometer. For the MMA7361L, we connected SLP to VDD. Choose which axis of the accelerometer will control the mouse cursor’s horizontal movement and connect its output to the transmitter Wixel’s P0_2 pin. If your accelerometer is oriented as shown in the picture above, you should use the Y axis. Choose which axis of the accelerometer will control the mouse cursor’s vertical movement and connect its output to the transmitter Wixel’s P0_1 pin. If your accelerometer is oriented as shown in the picture above, you should use the X axis. Connect a normally-open (NO) pushbutton between the transmitter Wixel’s P1_2 pin and GND. This will be the left mouse button. The P1_2 input line has an internal pull-up resistor, so the voltage on that line should be high (3.3 V) when the button is not pressed. When the button is pressed, the voltage should go low (0 V). In the same manner, connect a pushbutton between the transmitter Wixel’s P1_7 pin and GND. This will be the right mouse button. ParametersBoth the transmitter and receiver app have a parameter called radio_channel. The channel number is from 0 to 255 and determines which frequency to broadcast on. The default is 128. The transmitter and receiver must be on the same channel to talk to each other. To avoid interference, Wixels that aren’t supposed to talk to each other should be at least 2 channels away from each other. For example, you could have one pair of Wixels on channel 128 and another pair on 130. The transmitter app has additional parameters to configure the behavior of the mouse:
Alternative PartsYou could replace the battery pack with a single 9 V battery and a step-down regulator that outputs voltage within the Wixel’s 2.7–6.5 V operating range, such as our step-down voltage regulator D24V3ALV, or you could use a 1- or 2-cell holder along with an appropriate step-up voltage regulator, such as our 5V boost regulator NCP1402. You could replace the accelerometer by any other accelerometer whose outputs are equal to one half of the input voltage when the acceleration on the corresponding axis is 0. Mouse Speed CalculationThe mouse speed is calculated from the measured acceleration vector of the device. The acceleration vector normally points straight upwards and has a magnitude of 1 g due to the Earth’s gravity. The Wixel measures the X and Y outputs from the accelerometer, which tell it the components of the device’s acceleration vector in the plane of the accelerometer. The resulting two-dimensional vector is then multiplied by its own magnitude to achieve greater control at lower speeds. The vector is then multiplied by the speed parameter to convert it into a mouse speed which is reported wirelessly to the computer. 9.g. Serial-to-I²C AppOverviewThis app turns a Wixel into a serial-to-I²C bridge, acting as a master controller on a single-master I²C bus. To perform I²C operations, another device can issue serial ASCII commands to the Wixel on its radio, UART, or USB interface. I²C is a two-wire interface that is commonly used for communications on peripherals like the LSM303DLHC compass and the BMP085 pressure sensor. The official specification (371k pdf) for the I²C bus is published by NXP. Installation InstructionsDownload Serial-to-I²C App 1.0 (26k wxl). Open it with the Wixel Configuration Utility, choose your parameters, and then write it to a Wixel. See Section 4 for more information on how this is done. Default Pinout
DescriptionThis device appears to the USB host as a Virtual COM Port (with USB product ID 0x2200). If you are using Windows, you should see an entry labeled “Wixel” in your Device Manager in the “Ports (COM & LPT)” category while the app is running. There are three basic bridge modes that can be selected:
You can select which bridge mode you want to use by setting the bridge_mode parameter to the appropriate number (from the list above). The default bridge mode is Radio-to-I²C (0). The UART RX pin has an internal 20 kΩ pull-up resistor. The I²C lines (SCL and SDA) are on P1_0 and P1_1, respectively, by default; these can be changed with the I2C_SCL_pin and I2C_SDA_pin parameters. They do not have pull-ups enabled, so external pull-ups must be added to form a bus that conforms to the I²C specification. (Some carrier boards for I²C devices include pull-ups on these lines.) The I²C bus frequency is 100 kHz by default, which can be changed with the I2C_freq_kHz parameter. This app does not support I²C arbitration, which means it cannot be used on multi-master I²C buses. Serial CommandsThis app listens on the selected serial interface for commands and performs the corresponding I²C transactions. The command format is similar to the one used by the NXP SC18IM700 Master I²C-bus controller with UART interface. Three commands, in the form of ASCII characters, are recognized:
The general format for a command sequence begins with a START command (‘S’), followed by a slave device address, the number of data bytes to be written or read, the data to be written (if a write is being done), and finally a STOP command (‘P’). If a read is being done, the data read from the slave device will be returned on the serial interface. The least significant bit of the slave device address (the data direction bit) indicates whether the operation is a write (0) or a read (1). A repeated START condition can be generated by issuing another START command without sending a STOP command. For example, to write the value 0x2E to register 0xF4 on a slave device with the write address 0xEE, the following sequence of bytes could be sent to the Wixel:
To read a two-byte value from register 0xF6 on the same device, whose read address would be 0xEF, the following sequence could be issued (the second ‘S’ generates a repeated START):
The Wixel would respond with the two data bytes read from the slave. Any invalid or unrecognized command is ignored and causes the Invalid Command error bit to be set. To prevent an unfinished command sequence from leaving the I²C bus in an unusual state, this app will time out and reset the bus if a byte is not received on the serial interface within 500 ms of the last byte. After this happens, the Command Timeout error bit will be set, and a new command sequence must be initiated with a START command. The command timeout delay can be changed with the cmd_timeout_ms parameter; a value of 0 disables this timeout. If the Wixel receives a Get Errors command (‘E’), it will respond with a single byte containing the status of several error conditions. This command can be issued any time the app is not expecting a slave address or data byte. When an error occurs, the corresponding bit in the error byte is set and remains set until the errors are read with the Get Errors command, after which it is cleared internally. The following table shows the error condition that corresponds to each bit:
Indicator LEDsThe green LED behaves as described in Section 1.a, and also flickers when there is data transferred over USB. The yellow LED is on when VIN power is detected. The red LED indicates an error condition when lit; it can be reset by issuing a Get Errors command (described above). General Parameters
Pin Assignment ParametersThe following parameters can be used to reassign the I²C lines to different pins on the Wixel. The value of each parameter must be the number of an unused pin on the Wixel. The number can be computed by multiplying the first digit in the pin name by 10 and adding it to the second digit in the pin name. For example, if you wanted to assign the SCL pin to P1_2, you would set I2C_SCL_pin to 12.
CaveatsData will be lost if the Wixel receives commands on the UART’s RX line faster than they can be processed on the I²C bus. If you have trouble, try reducing the amount of data sent to the RX line by lowering the baud rate or adding delays to your microcontroller’s code. Using the Get Errors command and checking the UART Overflow error bit is a good way to detect this problem. Caution: The Wixel’s I/O lines are not 5V tolerant. You must use level-shifters, diodes, or voltage dividers to connect the Wixel to outputs from 5V systems. Also, avoid drawing more current from an I/O line than it can provide (see the discussion of P1_0 and P1_1 in Section 1.a). Avoid connecting multiple output pins together. The Wixel does not support the RS-232 voltage levels typically used by DB9 serial ports. The Wixel’s I/O lines, including the RX and TX lines, operate on voltages between 0 and 3.3 V. To connect the Wixel to an RS-232 serial signal, you will need additional level-shifting and inverting hardware like the Pololu 23201a serial adapter (RS-232 serial is inverted; the Wixel’s serial interface expects non-inverted serial). Versions
10. Writing Your Own Wixel App10.a. Getting Started in WindowsTo get started developing your own Wixel Apps using Windows as the development platform, we recommend that you download and install the Pololu Wixel Development Bundle: wixel-dev-bundle-120127.exe (10MB exe). This bundle contains four things:
10.b. Compiling an Example AppAfter you have installed all the necessary software (either from the Wixel Development Bundle or from other sources), you should try compiling an example app and loading it onto a Wixel to make sure that your system is set up correctly. Compiling AppsGo to the folder where you installed the Wixel SDK (
You have now built all the apps in the Wixel SDK and all the libraries that they depend on. Every subfolder of the You might get the following error message from make in Windows: make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x425073) If you get this error, please run “make -v” at a Command Prompt and make sure that you are running GNU Make 3.82-pololu2. This version of make is included in the latest Wixel Development Bundle (see Section 10.a). If the output from “make -v” shows some other version of make even after installing the Wixel Development Bundle, then you should remove that other version of make from your PATH or reorder your PATH so that version 3.82-pololu2 is used. You can edit your PATH environment variable from the Control Panel. See the pololu/make wiki on GitHub for more information on this problem. Loading an App onto Wixels from the Command LineWhile you are developing an app, it can be useful to have a way to load an app onto the target Wixel from the command line. You can do this with the Makefile: plug a Wixel into your computer, open up a command prompt, navigate to the
The example blink LED application should be running now. The Wixel’s yellow LED should be off, and the red LED should be blinking. If that is the case, then congratulations! You have successfully compiled a program and loaded it onto the Wixel. You can also specify settings at the command line. Try running this command: make load_example_blink_led S="blink_period_ms=100" You should now see the LED blinking 5 times faster than it was before. To specify multiple settings, put other settings inside the quotes and separate all settings with spaces. Opening an App with the Wixel Configuration UtilityYou can also open the app in the Wixel Configuration Utility if you want to. Try running this command: make open_example_blink_led The Wixel Configuration Utility should start running and open the example_blink_led app. Creating Your Own AppsNow that you know how to compile apps and quickly load them onto the Wixel to test them, you are ready to develop your own Wixel apps. You can either modify one of the existing apps in the SDK or create your own app. To create your own app, simply copy one of the existing app folders and change the name. You do not need to modify the Makefile when you create a new app; the Makefile will automatically detect the app as long as it is in the apps folder. When you are developing your app, you can use all of the commands above except you should replace “example_blink_led” with the name of your app (the name of the subfolder in the apps folder). For more information, including documentation of all the libraries in the Wixel SDK, see the Wixel SDK Documentation. 10.c. Using the Eclipse IDE
You can develop Wixel applications using any text editor. If you use the free, open source Eclipse IDE, you can benefit from some of its advanced C/C++ editing features. The following is a tutorial on how to set up Eclipse for use with the Wixel SDK.
Improving the configuration of Eclipse
Advanced Features of EclipseThe attraction of using Eclipse is the large number of advanced C/C++ editing features it provides. Here are just a few of these features:
Hiding Unused FeaturesBy default, Eclipse has a large number of toolbar buttons, views (panes), and menu items that are not needed for developing Wixel applications. You can greatly simplify the user interface of Eclipse by hiding those items. To hide unused toolbar and menu commands, select Window > Customize Perspective…. This brings up the “Customize Perspective C/C++” window. Select the “Command Groups Availability” tab. By unchecking a command group in this tab, you can automatically remove all the commands in that group from the toolbars and the menus. The only useful command groups for developing Wixel applications are: C/C++ Coding, C/C++ Editor Presentation, C/C++ Element Creation, C/C++ Navigation, C/C++ Open Actions, C/C++ Search, Editor Navigation, Editor Presentation, Keyboard Shortcuts, Open Files, Search If you want further customization, you can use the “Tool Bar Visibility” and “Menu Visibility” tabs to show or hide individual commands. 10.d. Sharing Your App with the Wixel CommunityPreparing your app for the communityPlease make sure that you have set up the following sections in your WXL file:
Copyright (c) 2011 <YOUR NAME>. Documentation for this app is available at: http://<YOUR SITE>/ Copyright (c) 2011 Pololu Corporation. For more information, see http://www.pololu.com/ http://forum.pololu.com/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Announcing your app on the Wixel forumWhen you are ready for the community to try out a version of your app, you may announce it on the Wixel forum, attaching your WXL file. It is helpful to paste a copy of your description into your post so that we can see what your app is about before downloading it. Contributing your source codeSharing your source code greatly increases the value of your app, since other members of the community will be able to adapt it to their own projects or learn from your code. You might also have made changes to the common sections of the Wixel SDK that you would like us to incorporate, or you might have discovered and want to share your fixes. For all of these reasons, we are maintaining the Pololu Wixel SDK Repository on GitHub as a central location for sharing Wixel code. You can easily use this site to fork your own version of the Wixel SDK, show us what you are working on, submit changes, and so on. GitHub uses the Git Version Control System for tracking versions and branches of code, so we highly recommend learning how to use Git if you want to share your code with the Wixel community or even just to get the latest version for your own use. Teaching Git is beyond the scope of this User’s Guide, but there are many good tutorials available on the web. For example, the Git tutorial provided by GitHub will help you get started. For the rest of this section, we will assume that you are comfortable with Git. If you have been following the instructions in this document, your code is located within the git log This should display a list of recent commits in the repository. Alternatively, you can use the program git add <list of new files...> git commit -a Alternatively, you can use the “Commit…” command of TortoiseGit. Either way, you will be shown a list of new or modified files and prompted for a commit message. Please check this over carefully and write a good description of your changes, because it is very hard to change your commits after you make them public. In some cases, you might want to start over with a fresh copy of the Wixel SDK, which you can make by typing git clone -o pololu git://github.com/pololu/wixel-sdk.git into a command prompt. At any time, you can download the latest updates from us and merge them into your code by typing the following command: git pull pololu Initially, you will commit your changes to your local repository, but when you are ready to publish them, you should set up your own repository on GitHub to make them accessible to the community. To do this, sign up for a GitHub account and fork our repository into a repository on your account. Please do this by clicking the “fork” button at the top of our repository so that it will be connected within the GitHub system – this way we will see your changes and can easily incorporate them into the SDK. After making your fork, you can push all of the changes from your local repository to GitHub with git remote add myrepo <GitHub URL> git push myrepo where Finally, you will probably want to post a link to your GitHub repository on the Wixel forum. This will help others find out about it and give you feedback on your contribution. 10.e. USB Configurations Recognized by the Wixel Configuration SoftwareThe Wixel Configuration Utility and the Wixel Command-Line Utility can currently only recognize certain Wixel apps. If your app is not recognized, then users of your app will not easily be able to reconfigure it after they have loaded it onto their Wixel (they will have to get their Wixel into bootloader mode manually). To be recognized, your app must implement a particular USB interface. Specifically, it must implement a USB CDC ACM virtual COM port with vendor ID 0x1FFB and product ID 0x2200. When the USB host sends a command to your app that sets the baud rate to 333, your app should enter bootloader mode. Your app should work with the In the future we will add support for other types of USB interfaces if there is a need for it. Please contact us if you would like to use other types of interfaces in your apps. 10.f. Wixel App File FormatFor the purpose of loading a compiled program onto a Wixel, the Wixel Configuration Utility and the Wixel Command-Line Utility (WixelCmd) accept two file formats: Intel HEX (.hex) and Wixel App (.wxl). The Intel HEX (.hex) file format is an industry standard, and can be produced by most toolchains. The Wixel App (.wxl) file format is a simple format created by Pololu that includes an Intel HEX file inside it along with important metadata, such as the names and addresses of user-configurable parameters. The Wixel App file format is designed to be extensible and easy to generate. The Wixel App file is plain text: every byte is an ASCII-encoded character. The allowed ASCII codes are 0x20 through 0x7F and also 0x09 (tab), 0xA (new line, “\n”), and 0xD (carriage return, “\r”). The bytes in a Wixel App file are divided into lines. Line endings can be encoded with any of the following byte sequences: “\r\n” (0xD, 0xA), “\r” (0xD), or “\n” (0xA). The first line must be “Pololu Wixel Application - www.pololu.com”. This line explains the purpose of the Wixel App file. The second line must be “1.0”. This specifies the version number of the file format used in the file. The third line and all the lines below it are divided into sections. Each section has a one-line header at the top of it that specifies the name of the section. The header line consists of 6 equals signs ( The hex sectionThe hex section contains an Intel Hex file that specifies the bytes to write to the flash of the Wixel. See the Intel HEX page on Wikipedia for more information. The flash memory region on the CC2511F32 that is available for Wixel applications consists of addresses 0x400 through 0x77FF (inclusive). Any line of the HEX file that writes to bytes outside of this region will be ignored. The license sectionThe license section is a human-readable section that should specify the terms under which others may distribute copies or modifications of the app. The Wixel SDK automatically inserts the MIT license into all Wixel App files because that is required by the Wixel SDK’s license. The description sectionThe description section is a human-readable section that should describe what the app does or link to a web site about the app. The cdb sectionThe cdb section contains the names and addresses of the user-configurable parameters. For each parameter, there must be two lines in this section (not necessarily consecutive) as specified below. One line contains the address of the parameter, and must be of the form: Another line contains the type of the parameter, and must be of the form: The Wixel SDK generates the cdb of section by running grep on the CDB file produced by SDCC during the linking step, selecting all lines containing the string “param”. This means you can define a parameter simply by writing the following code in your Wixel App, outside of any function: int32 CODE param_NAME = DEFAULT_VALUE; where NAME is the name of your parameter and DEFAULT_VALUE is the default value it will have if the user does not change its value. This default value is stored in the hex section, not the cdb section. You could put your entire CDB file in the WXL file if you wanted to; the software ignores unrecognized lines. However the CDB file can be hundreds of kilobytes long so this is not encouraged. Wixel App files usually have non-Windows line endings in the cdb section so they can not be viewed properly in Notepad or other text editors that only recognize Windows line endings. 11. The Wixel USB BootloaderThe Wixel comes with a USB bootloader that can be used in conjunction with the Wixel Configuration Utility or WixelCmd to upload apps to the Wixel (no external programmer is required). This section documents some technical details of the bootloader and is intended for advanced users. Flash Memory SectionsThe bootloader occupies the first 1 KiB (1024 bytes) and the last 2 KiB of the CC2511F32’s flash memory. Those sections of memory are protected to prevent accidental corruption of the bootloader. The remaining 29 KiB of flash, known as the application section, is available for the app. The bootloader places no restrictions on what data can be written to the application section. However, the bootloader will consider the application to be invalid and not allow any code in the application section to run if the first byte of the application section (address 0x400) is 0xFF, which should never be the case for an application that is compiled correctly. The CC2511’s standard entry vector and the interrupt vectors are remapped by the bootloader to the beginning of the application section. The application’s entry vector should be placed at 0x400. The first interrupt vector should be at 0x403 and consecutive interrupt vectors should be 8 bytes apart. The application can put the Wixel into bootloader mode by jumping to address 0x6 using an The block of flash memory from 0x3CC to 0x3FF in the bootloader is used to store some information that can be read by the application:
The bytes in the 0x3CC–0x3FF region not mentioned above are reserved and contain only zeros. Startup Procedure
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Log In
|
Wish Lists
|
BIG Order Form
|
Shopping Cart
US toll free: 1-877-7-POLOLU ~
(702) 262-6648 |
|||||||||||||
| Catalog | Forum | Resources | Distributors | Ordering | About | Contact | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|