Caliper Data Output:

# BCD Digital Caliper Data Format

Calipers output data in formats other than the 24-bit groups described on the previous page.

Binary-coded decimal (BCD) is a simple way to store decimal numbers in an otherwise binary world (base 2). Instead of using four bits (a nibble) to represent a number from 0-15, it is only used to store a digit from 0 to 9. Although storage is less compact, it can be easier to display.

Full logic analyzer trace of BCD digital caliper data format.

Above is the caliper output in binary-coded decimal format. The caliper LCD reads “9.8015” inches.

The total packet time is 53.64 µs + 728.1 µs = 781.74 µs

The data format consists of seven groups of four bits. Data should be read at clock falling edge.

The first six groups are six numeric nibbles (a nibble is 4 bits) in least-significant bit format and least significant digit order. In this example, the nibbles read “1, 0, 8, 9, 0, 0”.

The seventh (last) group is a flag nibble (4 flag bits).

Byte and bit length of BCD digital caliper data format.

Each nibble begins with a 60.4 µs start bit. Each data bit of the nibble is 13 µs in length.

Flags of BCD digital caliper data format.

The final nibble has flags: “NHM?”

Assuming you flip this nibble into MSB order like the previous nibbles, the flags are: “?MHN”

• ? = unknown bit
• M = metric if high
• H = half bit ('5') in the final place if high. That gives us the 5 of “009.8015”
• N = negative. (Minus sign.)

Note: If the metric bit is set, then the numbers represent millimeters and you'll need to handle the conversion in your software. Unlike the 24-bit format on the previous page, the values output by the caliper on this page switch between metric and imperial when the caliper’s units button is pressed.

Intervals between data packets in BCD digital caliper data format.

The interval from packet to packet is almost 320 ms (milliseconds as opposed to microseconds). The packet length is 53.64 µs + 728.1 µs = 781.74 µs or 0.782 milliseconds. So, the channel is only busy 0.782 ms / 320 ms = 0.2% of the time.

This length of time between data packets can be a problem for projects that need faster updates. Some people have reported that bringing pins low can switch the caliper into a faster rate mode. This functionality will vary based on caliper model.

## Results

I’ve written software that can read either caliper data format and display it on an LCD for my milling machine digital readout (DRO). Three calipers plus the mill tachometer are read and displayed simultaneously.

It works pretty well most of the time and is very accurate. Some problems include:

• Because of the fast bit rate once a packet begins, the microcontroller has to disable interrupts and fully dedicate its processing power to reading a stream.
• In the event that more than one caliper tries communicating at the same time, the microcontroller must be smart enough to service the data source that hasn’t been read as recently.
• The longer length calipers occasionally reset during usage. I have to stop machining and realign the x/y values before continuing. Glass slides or absolute value calipers would not produce the same problems.
• Because digital calipers have metal slides and measure distance using capacitance, you need to be careful about how you mount them in equipment. Unintentional electrical connections (such as ground loops) may form and interfere with accurate readings. I use nylon screws, nylon washers, and plastic mounts/spacers to avoid this problem. However, keep in mind that plastics may shear under stress.