Optoelectronics, Inc.
M1 Handicounter
Serial Interface Specification
Interface Version 1.1
May 10, 2001
INTRODUCTION
This document describes the serial interface of the M1 Handicounter, a miniature hand-held
frequency counter capable of measuring the frequency of VHF and UHF transmitters and other
signal sources. The M1 is capable of automatically capturing and storing up to 100 frequencies.
This frequency data can then be downloaded to a personal computer for logging and analysis.
This document was written to assist the programmer in developing computer software applications
for the M1.
Optoelectronics, Inc. assumes no responsibility for the accuracy of the information contained in this
document. Optoelectronics, Inc. is under no obligation to provide technical support on matters
pertaining to this document, or to provide notification of changes or corrections to this document. To
inquire about possible revisions, or to order copies of this document, contact the factory. A nominal
fee may be charged to cover printing and shipping costs.
OPTOELECTRONICS, INC.
5821 N.E. 14th Avenue
Fort Lauderdale, FL 33334
Phone: (954) 771-2050
FAX: (954) 771-2052
[Link]
2
ABOUT CI-5
The serial interface on the M1 conforms to the Icom CI-V interface standard. However,
Optoelectronics has added enhancements in the form of additional commands and features.
Optoelectronics has, therefore, modified the name of this new enhanced interface to CI-5.
The CI-5 interface is an asynchronous, half-duplex, Transistor-Transistor Logic (TTL) serial interface
connected in a wire-OR (bussed) configuration. Several different devices can be connected to the bus
simultaneously, and each device has its own unique address. Software developers who are
unfamiliar with the CI-5 interface are strongly encouraged to obtain a copy of the Icom
Communication Interface - V Reference Manual from Icom, Inc. for detailed information on the CI-V
interface protocol. The communications parameters for the serial interface are listed in Table 1
below.
Table 1. Communications Parameters.
DATA RATE 9600 bps
START BITS 1
DATA BITS 8
PARITY NONE
STOP BITS 1
One important thing to note about the CI-5 interface is that, as mentioned above, it is connected in a
wire-OR configuration. This means that the transmit data signal and the receive data signal are
connected together. Therefore, when a command is transmitted by the computer, it is automatically
echoed back as received data, followed by the response to the command, if any. For example, if an
11-byte command is transmitted to a device on the bus, which returns a 6-byte response, the
computer will receive a total of 17 bytes. This configuration allows devices on the bus to monitor
their own transmissions in order to detect interface collisions. A collision occurs when two or more
devices transmit simultaneously. If a collision occurs, the command must be re-transmitted.
To connect the M1 to a personal computer, a subminiature (2.5 mm) phone jack is provided on the
top panel. An external interface converter box, such as the Optoelectronics Optolinx, is required to
connect the M1 to an RS-232C computer interface. Its purpose is to convert the CI-5 interface
voltage levels to RS-232C levels compatible with most personal computers.
3
COMMAND REFERENCE
The M1 accepts commands over the CI-5 interface. In this section, all CI-5 command and response
bytes are expressed in hexadecimal notation. The M1 recognizes 10 different commands, which are
summarized in Table 2 below.
Following the command summary table is a detailed description of each of the commands, including
examples illustrating their use. In the command descriptions, "ra" refers to the RECEIVE
ADDRESS, and "ta" refers to the TRANSMIT ADDRESS.
The RECEIVE ADDRESS is the address of the M1, which is fixed at 96. Each device on the CI-5
bus must have its own unique address. The M1 will not process any command in which the
RECEIVE ADDRESS is not 96. However, the M1 will process commands with a RECEIVE
ADDRESS of 00, but all command responses will be suppressed. A RECEIVE ADDRESS of 00 has
special meaning. It provides a means for a device on the CI-5 bus to transmit a command to all other
devices simultaneously. However, since several simultaneous responses would cause a collision, the
responses are suppressed.
The TRANSMIT ADDRESS is the address of the device which is transmitting the command to the
M1. In most cases, this device is a personal computer executing application software, usually
referred to as the CONTROLLER. The standard address for the CONTROLLER is E0, but any
address can be used for the TRANSMIT ADDRESS. However, the TRANSMIT ADDRESS must be in
the range 01 to EF. Also, the M1 will not process any command in which the TRANSMIT
ADDRESS matches its own address, 96.
It is important to remember that the values specified are not ASCII characters, but are bytes
expressed in hexadecimal notation. For example, “FE” represents a single byte with a value of 0xFE
(hexadecimal), or 254 (decimal). It does not represent the ASCII character “F” followed by the ASCII
character “E”, a two-byte sequence.
Table 2. M1 CI-5 Interface Command Summary.
COMMAND SUB-COMMAND DESCRIPTION
03 - Read frequency.
06 - Write mode.
15 02 Read signal strength.
7F 09 Read identification
7F 20 Read gate setting.
7F 21 Write gate setting.
7F 22 Read frequency memory.
7F 24 Clear memory.
7F 25 Read range setting.
7F 26 Write range setting.
4
READ FREQUENCY
Command:
FE FE ra ta 03 FD
Example:
FE FE 96 E0 03 FD
Response:
FE FE ta ra 03 frequency FD
Examples:
162.55000000 MHz
FE FE E0 96 03 00 00 00 55 62 01 FD
1045.72500000 MHz
FE FE E0 96 03 00 00 50 72 45 10 FD
Error
FE FE E0 96 FA FD
Description:
This command instructs the unit to send the current counter frequency measurement result.
The frequency data is in the form of 6 bytes, each consisting of 2 BCD digits. The order of the 12
BCD digits is as follows: 0.1 Hz digit, 0.01 Hz digit, 10 Hz digit, 1 Hz digit, 1 kHz digit, 100 Hz digit,
100 kHz digit, 10 kHz digit, 10 MHz digit, 1 MHz digit, 1 GHz digit, 100 MHz digit. See the
examples shown above.
If the command length is incorrect, then the command is ignored, and the error response is returned.
5
WRITE MODE
Command:
FE FE ra ta 06 ms FD
ms is a BCD value representing the selected operating mode. BCD values are encoded as
follows:
00: NORMAL mode
01: FILTER mode
02: CHANNEL mode
03: CAPTURE mode
04: RECALL mode
Examples:
NORMAL mode
FE FE 96 E0 06 00 FD
CAPTURE mode
FE FE 96 E0 06 03 FD
Response:
FE FE ta ra FB or FA FD
Examples:
OK
FE FE E0 96 FB FD
Error
FE FE E0 96 FA FD
Description:
This command selects the operating mode.
The mode select data is in the form of 1 byte, consisting of 2 BCD digits. See the examples shown
above.
If the command length is incorrect, or if the mode select code is not valid, then the command is
ignored, and the error response is returned.
6
READ SIGNAL STRENGTH
Command:
FE FE ra ta 15 02 FD
Example:
FE FE 96 E0 15 02 FD
Response:
FE FE ta ra 15 02 sd FD
Examples:
0 bargraph segments
FE FE E0 96 15 02 00 00 FD
5 bargraph segments
FE FE E0 96 15 02 00 05 FD
16 bargraph segments
FE FE E0 96 15 02 00 16 FD
Error
FE FE E0 96 FA FD
Description:
This command instructs the unit to send the current signal strength.
The signal strength data is in the form of 2 bytes, each consisting of 2 BCD digits. The signal
strength is reported as the number of bargraph segments active. The reported signal strength
ranges from a minimum signal of 0 bargraph segments active to a maximum signal of 16 bargraph
segments active. See the examples shown above.
If the command length is incorrect, then the command is ignored, and the error response is returned.
7
READ IDENTIFICATION
Command:
FE FE ra ta 7F 09 FD
Example:
FE FE 96 E0 7F 09 FD
Response:
FE FE ta ra 7F 09 id sv iv FD
Example:
M1 A version, software version 2.0, interface version 1.1
FE FE E0 96 7F 09 4D 31 41 20 11 FD
M1 B version, software version 2.0, interface version 1.1
FE FE E0 96 7F 09 4D 31 42 20 11 FD
Error
FE FE E0 96 FA FD
Description:
This command instructs the unit to send the identification information.
The identification data is in the form of 5 bytes, each consisting of 2 digits. The first 6 digits
uniquely identify the device. The next 2 BCD digits indicate the current software version. The last 2
BCD digits indicate the current interface version.
If the command length is incorrect, then the command is ignored, and the error response is returned.
8
READ GATE SETTING
Command:
FE FE ra ta 7F 20 FD
Example:
FE FE 96 E0 7F 20 FD
Response:
FE FE ta ra 7F 20 gs FD
gs is a BCD value representing the selected gate setting. BCD values are encoded as follows:
00: 10 kHz resolution gate setting
01: 1 kHz resolution gate setting
02: 100 Hz resolution gate setting
03: 10 Hz resolution gate setting
04: 1 Hz resolution gate setting
05: 0.1 Hz resolution gate setting
Examples:
10 kHz resolution
FE FE E0 96 7F 20 00 FD
100 Hz resolution
FE FE E0 96 7F 20 02 FD
Error
FE FE E0 96 FA FD
Description:
This command instructs the unit to send the current gate setting.
The gate setting specifies the counter gate time, and, hence, the measurement resolution of the
frequency counter. The gate setting data is in the form of 1 byte, consisting of 2 BCD digits. See the
examples shown above.
If the command length is incorrect, then the command is ignored, and the error response is returned.
9
WRITE GATE SETTING
Command:
FE FE ra ta 7F 21 gs FD
gs is a BCD value representing the selected gate setting. BCD values are encoded as follows:
00: 10 kHz resolution gate setting
01: 1 kHz resolution gate setting
02: 100 Hz resolution gate setting
03: 10 Hz resolution gate setting
04: 1 Hz resolution gate setting
05: 0.1 Hz resolution gate setting
Examples:
1 kHz resolution
FE FE 96 E0 7F 21 01 FD
10 Hz resolution
FE FE 96 E0 7F 21 03 FD
Response:
FE FE ta ra FB or FA FD
Examples:
OK
FE FE E0 96 FB FD
Error
FE FE E0 96 FA FD
Description:
This command selects the gate setting.
The gate setting specifies the counter gate time, and, hence, the measurement resolution of the
frequency counter. The gate setting data is in the form of 1 byte, consisting of 2 BCD digits. See the
examples shown above. Note that when the Lo-Z prescaled count range setting is selected, only the
first 4 gate settings are valid.
If the command length is incorrect, or if CAPTURE mode or RECALL mode is selected, or if the gate
select code is not valid, then the command is ignored, and the error response is returned.
10
READ FREQUENCY MEMORY
Command:
FE FE ra ta 7F 22 memory FD
Examples:
Memory location 0
FE FE 96 E0 7F 22 00 00 FD
Memory location 63
FE FE 96 E0 7F 22 00 63 FD
Memory location 99
FE FE 96 E0 7F 22 00 99 FD
Response:
FE FE ta ra 7F 22 frequency FD
Examples:
162.550000 MHz
FE FE E0 96 7F 22 00 00 55 62 01 FD
1045.725000 MHz
FE FE E0 96 7F 22 00 50 72 45 10 FD
Error
FE FE E0 96 FA FD
Description:
This command instructs the unit to send the frequency stored in the specified memory location.
The specified memory location data is in the form of two bytes, each consisting of two BCD digits.
The specified memory location must be in the range 0 to 99. The frequency data is in the form of five
bytes, each consisting of two BCD digits. The order of the ten BCD digits is as follows: 10 Hz digit, 1
Hz digit, 1 kHz digit, 100 Hz digit, 100 kHz digit, 10 kHz digit, 10 MHz digit, 1 MHz digit, 1 GHz
digit, 100 MHz digit. See the examples shown above.
If the command length is incorrect, or if the specified memory location is not in the range 0 to 99,
then the command is ignored, and the error response is returned.
11
CLEAR MEMORY
Command:
FE FE ra ta 7F 24 FD
Example:
FE FE 96 E0 7F 24 FD
Response:
FE FE ta ra FB or FA FD
Example:
OK
FE FE E0 96 FB FD
Error
FE FE E0 96 FA FD
Description:
This command clears all frequency memory locations.
Once this command is executed, all frequency memory locations are set to zero. The M1 can then
begin to capture 100 new frequencies. This command has the same effect as turning the unit on
while holding down the MODE switch.
If the command length is incorrect, then the command is ignored, and the error response is returned.
12
READ RANGE SETTING
Command:
FE FE ra ta 7F 25 FD
Example:
FE FE 96 E0 7F 25 FD
Response:
FE FE ta ra 7F 25 rs FD
rs is a BCD value representing the selected range setting. BCD values are encoded as follows:
00: Hi-Z direct count range setting
01: Lo-Z direct count range setting
02: Lo-Z prescaled count range setting
Examples:
10 kHz resolution
FE FE E0 96 7F 25 00 FD
100 Hz resolution
FE FE E0 96 7F 25 02 FD
Error
FE FE E0 96 FA FD
Description:
This command instructs the unit to send the current range setting.
The range setting specifies the counter input impedance and direct/prescale count mode. The range
setting data is in the form of 1 byte, consisting of 2 BCD digits. See the examples shown above.
If the command length is incorrect, then the command is ignored, and the error response is returned.
13
WRITE RANGE SETTING
Command:
FE FE ra ta 7F 26 RS FD
RS is a BCD value representing the selected range setting. BCD values are encoded as follows:
00: Hi-Z direct count range setting
01: Lo-Z direct count range setting
02: Lo-Z prescaled count range setting
Examples:
Hi-Z direct count range
FE FE 96 E0 7F 26 00 FD
Lo-Z prescaled count range
FE FE 96 E0 7F 26 02 FD
Response:
FE FE ta ra FB or FA FD
Examples:
OK
FE FE E0 96 FB FD
Error
FE FE E0 96 FA FD
Description:
This command selects the range setting.
The range setting specifies the counter input impedance and direct/prescale count mode. The range
setting data is in the form of 1 byte, consisting of 2 BCD digits. See the examples shown above.
If the command length is incorrect, or if RECALL mode is selected, or if the range select code is not
valid, then the command is ignored, and the error response is returned.
14
OPTOELECTRONICS, INC.
5821 N.E. 14th Avenue
Fort Lauderdale, FL 33334
Phone: (954) 771-2050
FAX: (954) 771-2052
[Link]
15