This file contains information about the cheap imported digital calipers and scales sold by companies like Harbor Freight and others. They come in various sizes from 6" to at least 24" and probably longer (at least for the scales, the largest calipers I've seen are 12"). While these aren't quite on the level of Mitutoyo and the like, they are still a great value and are just as accurate (at least from my experience). The function of this document is to describe some of the less well known features of these calipers since there isn't much documentation out there. The features I'm going to describe are 1) the data output port sometimes called an SPC output, and 2) the hidden modes feature. Also, I'm going to use the word "calipers" in this text but the information here should apply to many of the cheap imported scales as well. 1) The data output port ----------------------- Removing the cover in the upper right corner just opposite the battery will expose four gold contacts. __________________ ABCD _ | ____________ | |||| || | | | |______|| | | display | | | |____________| | |________________ battery _| --------- Which are: A) Used as the ground for the serial data and clock pulse signals and for external power. B) is the signal containing the actual data. C) is used to synchronize reads of the Serial Data. D) Used for the hidden button feature and for external power. Voltage levels are: logic low = 0V logic high = 1.3V = 0V ??? = 1.5V ??? : The clock pulse starts as follows: |<--- 51.8us --->| ->| |<-7.0us ________________ ___ ___ ___ / | | | | | | | |/ __| |___| |___| |___| / / 6.1us->| |<- ^ ^ ^ 1st bit 2nd bit 3rd bit It starts low and goes high for 51.8us. This serves to let you know that the data word will be coming up. The first falling edge signals that the first bit of the first data word should be read from the line. The next falling edge will signal that the next bit should be read from the line. There are 24 falling edges which makes for a 24bit data word. The data word is output starting with the least significant bit. |<----- 111.2us ------>| / ___ ___ ______________________ ___ ___ __/ / | | | | | | | | | | | / /__| |___| |___| |___| |___| |___|/ / / ^ ^ ^ ^ ^ 23rd bit 24th bit 1st bit 2nd bit 3rd bit After the last bit in the first data word the line goes high again for 111.2us. Then the next falling edge signals that the 1st bit of the second data word should be read. The second word is also 24 bits long and is timed exactly the same as the first word. |<----- 59.6us ---->| / ___ ___ ____________________ / | | | | | \ /__| |___| |___| \_____ / ^ ^ 9.2us->| |<- 23rd bit 24th bit After the last bit in the second word is read the line goes high for 59.6us. Finally it drops low again and stays low until the next output cycle. I haven't figured out the significance of the long decay time on the last falling edge. The first data word is the absolute position of the caliper stored in straight binary format. One count in the 24-bit value corresponds to 1/20480 of an inch. There is also an offset, so with the calipers completely closed the value will be greater than zero. The second data word is the position relative to the zero point and is reported to be stored in 2's complement (I haven't verified this myself). This makes sense though because the value could be negative. The Hidden Modes Feature ------------------------ This is something I stumbled accross purely be accident. I had soldered some wires to the output pins so I could look at the signals on a scope, and somehow the and wires accidentally touched together. To my amazement the caliper changed modes! So far I have discovered 4 different modes. [Normal Mode]: This is the state the calipers were in when I got them. When the slide is moved the display updates every 1/3 of a second and the data port sends a reading at the same interval. Pressing the zero button zero's the measurement. [Incremental? Mode] Here when the slide is moved the display updates approximately every 20ms along with the data port. However the zero button no longer zero's the measurement but instead holds the current reading. The zero point is fixed at whatever it was when this mode was selected. I'm only guessing that this is called "Incremental" mode because the display shows "INC" at the top. [Minimum Value Mode] This mode displays only the minimum value since the measurement was last reset. The measurement is reset by pushing the zero button twice. The zero point is fixed at whatever it was when this mode was selected. In this mode the display and data ports are updated every 20ms. [Maximum Value Mode] This mode displays only the maximum value since the measurement was last reset. The measurement is reset by pushing the zero button twice. The zero point is fixed at whatever it was when this mode was selected. In this mode the display and data ports are updated every 20ms. Changing Modes: This is the flowchart for navigating between the different modes. I'm pretending here that there is another button called "mode" that is used to change modes but really there isn't. So when you see {mode}, it means the and lines are shorted together. {zero} is just the normal zero button. --------------------------------------------------------- | /|\ | _____\|/_____ | | | | {zero} | | | Normal Mode |-----------> (zero measurement) | |_____________| | | | |{mode} | | | | | _______\|/__________ ____________________ | | | {zero} | | | | Incremental Mode |------------->| Incremental Mode |-------->| | Hold value |<-------------| Hold off | {mode} | |____________________| {zero} |____________________| | | | |{mode} | | | | | _________\|/__________ ______________________ | | | {zero} | | | | Minumum Value Mode |------------>| Minumum Value Mode |------->| | Hold value |<------------| Hold off | {mode} | |______________________| {zero} |______________________| | | | |{mode} | | | | | _________\|/__________ ______________________ | | | {zero} | | | | Maximum Value Mode |------------>| Maximum Value Mode |------->| | Hold Value |<------------| Hold off | {mode} |______________________| {zero} |______________________| Ok, well that's about it. I'm including below a copy of the only text that I could find describing the operation of these calipers in order to give credit where credit is due. It was a huge help in figuring out how these things work. It would have taken me forever without it! Thanks guys! Chris 11/28/2002 ================================================================================ "luskwyo" At 01:57 AM 1/11/02 -0000, you wrote: >Hi Lee: > I have been following the thread on the Cad Cam lists on decoding >the cheap digital calipers until it finally ran down. >Have you came up with a reasonable way to feed that idiot data stream >into a pc ? > I need a way to check the movement of a component due to thermal >expansion, so accuracy is better than speed. >I'm a electronics tech so any gory details are appreciated. >Thanks >Shane > > > ========================================================================== ========================================================================== ========================================================================== ========================================================================== It has and SPI interface with clock and data. The data "burst" has 2 sections of 24bits data equaling 48 bits per packet. The first 24bits are shifted out on the rising edge and qualified on the falling edge by the reading device. Bit timing was approx. 13uS clock cycle yielding about 6.5us to detect the falling edge and sample the data. Section1: The first section of 24 bits is also shifted out lsb first. This 24bit record is an 'absolute' binary count with a constant error offset, for example, when the caliper is fully closed (0.000) the count was 007FD3h(32723 decimal). By subtracting this value from the record then dividing by 5000h(20480decimal) you get the 'inch' readout. Section2: Bits are lsb first of a 24bit record. The 2nd section of 24bits is a 'relative' 24bit count subtracted from 0xFFFFFF ( 2's compliment) with scaling relation of 5000h(20480decimal) counts per inch. The mode buttons had no apparent affect on the data records sent out, other than freezing the 'relative' section, so the micro in the caliper must do a conversion by scaling for displaying the metric value. I wrote some quick and dirty Pic code to log data in hex format using Hyperterm. I cheated and used an emulator. I targeted a 16C558 running at 10Mhz, but may convert it to a 8pin part. I used 1/2 of an LM339 quad comaparator(cheap) to level shift the 1.5v logic to 5v for processing. Let me know what you think... -Lee >Date: Wed, 11 Oct 2000 21:16:45 -0700 >To: "Wilfried Fedtke" From ???@??? Wed Dec 13 20:10:40 2000 To: "Wilfried Fedtke" From: Lee & Chris studley Subject: Re: Digital Caliper Cc: Bcc: X-Attachments: In-Reply-To: <002801c0652b$b228eec0$37479d3e@w1> References: <3.0.1.32.20001213090213.007776fc@mail.phnx.uswest.net> I used an LM339 quad comparator to buffer and shift the signal in voltage and impedence to 5volts swing. I'll try to draw up the circuit for you. I think the speed of the data is going to be a problem with a direct connection to the parallel port. A Pic micro could provide the par allel interface easily. ========================================================================== X-Attachments: C:\WINDOWS\Desktop\caliper.pdf; In-Reply-To: <002401c06740$7734f0e0$5070e33e@w1> References: <3.0.1.32.20001213090213.007776fc@mail.phnx.uswest.net> <3.0.1.32.20001213201040.00e66728@mail.phnx.uswest.net> <3.0.1.32.20001214193631.00e66814@mail.phnx.uswest.net> Hi Wilfried, Here is an attached pdf file of the schematic for the Pic and LM339 Caliper circuit. I'll send the code soon. -Lee =========================================================================== The clock looks like this. 24clks 24clks _____XXXXXXX--XXXXXXXX_______________________________________XXXXXXX--XXXXXXXX----->>>> sample1 sample2 ... Data looks something like this: ____---____-__----_--_------------------------------------_____---____-----_--_ sample1 sample2