Example uses, Caveats, D. serial ascii-to-binary app – Pololu Wixel User Manual

Page 38: Overview, Installation instructions

Advertising
background image

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

• The TX line can be used to send commands to a microcontroller or other serial device.

• The RX line can be used to receive data from a microcontroller or other serial device.

• The DTR and RTS lines are general-purpose digital outputs that can be used to control something (such as an
LED) from a computer.

• The DSR and CD lines are general-purpose digital inputs that can be connected to a sensor or other circuit
and read from a computer.

Caveats

• The CC2511’s UARTs do not actually support 1.5 stop bits, so if you try to set the number of stop bits to 1.5,
this app will use 1 stop bit instead.

• The CC2511’s UARTs do not support having 2 stop bits very well, so if you set the number of stop bits to 2,
this app may fail to detect framing errors that occur during the second stop bit. Also, the next byte received after
the framing error occurred may be discarded even if that byte is valid. This problem only applies to receiving
bytes on the RX line; this app has no problem transmitting bytes on the TX line with 2 stop bits.

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

[http://www.pololu.com/product/126]

(RS-232 serial is inverted; the Wixel’s serial interface

expects non-inverted serial).

9.d. Serial ASCII-to-Binary App
Overview

This app uses the Wixel’s two UARTs to convert between ASCII characters and “binary” data with arbitrary bytes.
This can be useful if you are programming a controller with a serial interface that is limited to only transmitting ASCII
characters, but you want to control a device with a serial interface that requires you to send arbitrary bytes between
0x00 and 0xFF. This app can act as a translator between your controller and such a device.

Installation Instructions

Download

the

Serial

ASCII-to-Binary

App

(v1.0)

[http://www.pololu.com/file/download/serial-ascii-binary-

v1.0.wxl?file_id=0J640]

(17k 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.

Pololu Wixel User's Guide

© 2001–2014 Pololu Corporation

9. Wixel Apps

Page 38 of 64

Advertising