beautypg.com

Uart, B. ttl serial, Section – Pololu Jrk USB User Manual

Page 28

background image

UART

The UART serial mode.

In this mode, the TX and RX lines can be used to send commands to the jrk and receive responses from it. Any
byte received on RX will be sent to the Command Port, but bytes sent from the Command Port will be ignored. The
TTL Port is not used. The baud rate on TX and RX can either be automatically detected by the jrk when a 0xAA
byte is received on RX, or it can be set to a fixed value ahead of time. This mode is only available when the input
mode is serial. This mode allows you to control the jrk (and send bytes to a serial program on the computer) using a
microcontroller or other TTL serial device.

4.b. TTL Serial

If the jrk is in serial input mode, then its serial receive line, RX, can receive bytes when connected to a logic-level (0
to 4.0–5 V, or “TTL”), non-inverted serial signal. The bytes sent to the jrk on RX can be commands to the jrk or an
arbitrary stream of data that the jrk passes on to a computer via the USB port, depending on which Serial Mode the
jrk is in (

Section 4.a

). The voltage on the RX pin should not go below 0 V and should not exceed 5 V.

The jrk provides logic-level (0 to 5 V) serial output on its serial transmit line, TX. The bytes sent by the jrk on TX
can be responses to commands that request information or an arbitrary stream of data that the jrk is receiving from
a computer the USB port and passing on, depending on which Serial Mode the jrk is in. If you aren’t interested in
receiving TTL serial bytes from the jrk, you can leave the TX line disconnected.

The serial interface is asynchronous, meaning that the sender and receiver each independently time the serial
bits. Asynchronous TTL serial is available as hardware modules called “UARTs” on many microcontrollers.
Asynchronous serial output can also be “bit-banged” by a standard digital output line under software control.

The data format is 8 data bits, one stop bit, with no parity, which is often expressed as 8-N-1. The diagram below
depicts a typical asynchronous, non-inverted TTL serial byte:

Diagram of a non-inverted TTL serial byte.

A non-inverted TTL serial line has a default (non-active) state of high. A transmitted byte begins with a single low
“start bit”, followed by the bits of the byte, least-significant bit (LSB) first. Logical ones are transmitted as high (Vcc)
and logical zeros are transmitted as low (0 V), which is why this format is referred to as “non-inverted” serial. The
byte is terminated by a “stop bit”, which is the line going high for at least one bit time. Because each byte requires a

Pololu Jrk USB Motor Controller User's Guide

© 2001–2014 Pololu Corporation

4. Using the Serial Interface

Page 28 of 45