0% found this document useful (0 votes)
9 views15 pages

M1 Handicounter Serial Interface Guide

Uploaded by

syahruddincivil
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views15 pages

M1 Handicounter Serial Interface Guide

Uploaded by

syahruddincivil
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

Common questions

Powered by AI

A software developer may face several challenges when implementing the CI-5 protocol, such as handling the asynchronous half-duplex nature of the interface, managing unique device addresses, and dealing with echo data due to the wire-OR configuration. These challenges can be mitigated by thorough understanding and correct implementation of address management to prevent processing incorrect commands, and implementing collision detection and handling mechanisms through echoed data monitoring. Familiarity with BCD encoding and correct parsing of command structures are also crucial .

Incorrect command lengths in the CI-5 interface could lead to command misinterpretations or system errors. The M1™ Handicounter addresses this by ignoring commands with incorrect lengths and returning an error response to indicate the issue. This mechanism prevents erroneous operations and maintains system stability, allowing for correction and retrial of commands by the controller .

The M1™ Handicounter prevents and resolves data collisions using its wire-OR network topology, which allows devices to monitor their own transmissions. If a collision occurs—detected when two or more devices transmit simultaneously—the transmitted command must be re-sent. The interface’s ability to monitor transmissions allows it to detect these collisions promptly and take corrective actions, such as retransmission of commands .

The CI-5 interface manages command transmission by ensuring each device on the bus has a unique address. If the RECEIVE ADDRESS does not match that of the M1™, which is 96, the command will not be processed. However, it handles the RECEIVE ADDRESS 00 uniquely by allowing a command to be sent to all devices simultaneously, although responses are suppressed to avoid collisions from multiple simultaneous responses .

The Optoelectronics Optolinx™ is crucial for connecting the M1™ Handicounter to a personal computer because it serves as an interface converter. It is necessary to convert the TTL voltage levels of the CI-5 interface to RS-232C levels, which are compatible with most personal computer interfaces. Without this conversion, direct connection to a PC would be impossible due to voltage level incompatibility .

The M1™ Handicounter uses Binary-Coded Decimal (BCD) encoding for transmitting command and response data, where numeric values are encoded as pairs of BCD digits within byte structures. For instance, in the READ FREQUENCY command, frequency data is transmitted as 6 bytes of BCD digits, specifying digit values from 0.1 Hz to 100 MHz. Similarly, the WRITE MODE command uses a single byte of BCD to denote operational modes, such as NORMAL mode encoded as 00 and CAPTURE mode as 03 .

Unique device addresses are significant in the CI-5 protocol as they ensure correct communication between devices on the same bus. The M1™ Handicounter requires that any command directed to it has a RECEIVE ADDRESS of 96 to process the command. Address-related errors are managed by ignoring commands with incorrect addresses, and the M1™ itself will not process commands if the TRANSMIT ADDRESS matches its own. The protocol allows for broad commands using the RECEIVE ADDRESS of 00, but responses are suppressed to prevent data collisions .

The primary purpose of the CI-5 serial interface on the M1™ Handicounter is for communication and control between the device and other systems, such as a personal computer, allowing for the transmission of commands and receipt of data. The wire-OR configuration affects data transmissions by connecting the transmit and receive data signals together, which means any command sent by a computer is automatically echoed back as received data, followed by any response. This setup allows devices on the bus to monitor their own transmissions and detect interface collisions, which occur when multiple devices transmit simultaneously .

The 'WRITE RANGE SETTING' command is integral to adjusting the M1™ Handicounter's input impedance and count mode. By setting the range, users can select between Hi-Z direct count, Lo-Z direct count, and Lo-Z prescaled count range settings. Each setting affects the counter's sensitivity and ability to measure different frequency ranges. The command ensures that even when COUNT mode settings are invalid, or incorrect command lengths are provided, the command is ignored to maintain system integrity .

The M1™ Handicounter utilizes hexadecimal notation to define command and response bytes, which streamlines communication by allowing efficient representation and processing of numerical data within a byte structure. Hexadecimal format condenses data that would otherwise require larger binary or decimal representations, resulting in faster processing and transmission. The fixed structures simplify encoding and decoding operations, facilitating efficient programming and consistent data handling .

You might also like