beautypg.com

Serial port overview, Command format – Elecraft KXPA100 Programmers Reference User Manual

Page 3

background image

3

Serial port overview

Commands are sent to the KXPA100 via its “PC DATA” serial port. Use 4800, 9600, 19200, or 38400 bit/s,
8 bit characters, one stop bit and no parity. There is no hardware flow control. The KXPA Utility
discovers the KXPA100’s PC DATA serial port speed by sending a pair of null commands (;;) at each of the
supported speeds and selects the speed that results in responses. You can change the KXPA100’s PC
DATA serial port speed with the Baud Rate (^BRP) command.

Command Format

All commands and almost all responses use the printable ASCII character set (some KX3 responses such
as DS and IC contain unprintable characters).

Commands sent to the KXPA100 are either GET or SET.

GET commands are used to get information from the KXPA100; the information is returned in a
RESPONSE message.

SET commands are used to change the KXPA100’s internal state or to initiate an action. SET commands
do not generally generate a RESPONSE. SET can be followed by a GET to verify the SET.

KXPA100 commands generally start with a caret (^). This is done to distinguish KXPA100 commands from
KX3 commands.

A Host PC may be connected to the 3.5 mm TRS connector PC RS-232 serial port (using a KXUSB, KXSER,
or equivalent). The other KXPA100 serial port (included in the 8-conductor RJ-45 connector) may be
connected to a KX3 transceiver. The KXPA100 forwards KX3 commands (generally commands that do
not begin with “^”) to the “downstream” KX3.

Each serial command is terminated with a semicolon character. For example, to query the current
software revision, send “^RV;” (send ^, R, V, and semicolon).

Input commands and their responses are fixed length, and leading zeros are required on input and are
not suppressed on output. The command parser expects a command terminator (a semicolon) in
exactly the position indicated in this reference. Don’t embed spaces or omit leading zeros.

Generally, after sending a GET command, wait for the corresponding RESPONSE before sending more
commands. The KXPA100 has a limited input command buffer. You may safely “stack up” at least 64
bytes of commands without risk of overrun. If you wish to send a very long sequence of SET commands,
break them up with an intervening GET (such as the null command ; or ^RV;) that returns a RESPONSE,
and wait for those responses. Flow control is done at the application level.

Several commands require installation of an optional KXAT100 Antenna Tuner to be meaningful. For
example, you may set the ATU Capacitors with the ^CR command. If no Antenna Tuner is installed, the
microcontroller’s ports are set and may be read, but there are no ATU relays connected to these
microcontroller I/O ports.