Description, Serial commands – Pololu Wixel User Manual

Page 41

Advertising
background image

Description

This 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:

0. Radio-to-I²C: Serial commands from the radio are used to control I²C transfers. Data read from the I²C slave
is returned to the radio. Another Wixel running the standard

Wireless Serial app

[http://www.pololu.com/docs/0J46/

9.b]

can be used to communicate with this Wixel wirelessly.

1. UART-to-I²C: Serial commands from the UART’s RX line are used to control I²C transfers. Data read from
the I²C slave is returned to the UART’s TX line.

2. USB-to-I²C: Serial commands from the USB virtual COM port are used to control I²C transfers. Data read
from the I²C slave is returned to the virtual COM port.

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 Commands

This 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

[http://www.nxp.com/products/interface_and_connectivity/bridges/uart_to_i2c_master_gpio_bridges/SC18IM700IPW.html]

.

Three commands, in the form of ASCII characters, are recognized:

Command Description

‘S’

I²C START

‘P’

I²C STOP

‘E’

Get Errors

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:

Pololu Wixel User's Guide

© 2001–2014 Pololu Corporation

9. Wixel Apps

Page 41 of 64

Advertising