Digital Calipers
Hello,
I have a Chinese made (no name brand) digital caliper (harbor freight special). The calipers have a serial output with the following characteristics:
1). serial data sent lsb first and msb last (opposite of most serial conventions)
2). 1st set of 24bit data is absolute positioning, 2nd set of 24bits is relative position.
3). 24 bit binary number with 2's compliment for determining -/+
4). 20480 represents 1.0"
5). 77Khz to 90Khz clock out for sync serial out put
6). clock starts with 55us high pulse going low to start off data reception, after which data read on falling clock edges.
7). pause between 1st and 2nd 24bit data chunks is 110us
8). clock goes high after 2nd 24bit data chunk for 55us before starting all over again as in step 6
I want to use the SX (slave) and SX/B compiler to receive the clock and serial data from the calipers and output the numerical value of the payload on an LCD. Actually, I am only interested in the 2nd chunk of 24bits (relative position). I would appreciate any help or reference code I can use to get me started.
Best Regards,
Nick
·
I have a Chinese made (no name brand) digital caliper (harbor freight special). The calipers have a serial output with the following characteristics:
1). serial data sent lsb first and msb last (opposite of most serial conventions)
2). 1st set of 24bit data is absolute positioning, 2nd set of 24bits is relative position.
3). 24 bit binary number with 2's compliment for determining -/+
4). 20480 represents 1.0"
5). 77Khz to 90Khz clock out for sync serial out put
6). clock starts with 55us high pulse going low to start off data reception, after which data read on falling clock edges.
7). pause between 1st and 2nd 24bit data chunks is 110us
8). clock goes high after 2nd 24bit data chunk for 55us before starting all over again as in step 6
I want to use the SX (slave) and SX/B compiler to receive the clock and serial data from the calipers and output the numerical value of the payload on an LCD. Actually, I am only interested in the 2nd chunk of 24bits (relative position). I would appreciate any help or reference code I can use to get me started.
Best Regards,
Nick
·
Comments
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
Available now... SX-Video OSD module $59.95 www.sxvm.com
"Save your money. Pay with cash."
·
If Bean's suggestion works, then there you go.
On the other hand, I may be interpreting your post to read that the clock may be not fixed? If that is so you will need a speed-adaptive serial routine that tracks the clock, in which case I expect you will need considerably more than SHIFTIN.
If that is the case, then please let us know so we can help you with that.
Cheers,
Peter (pjv)
Is there two outputs (one clock and one data) ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
Available now... SX-Video OSD module $59.95 www.sxvm.com
"Save your money. Pay with cash."
·
The clock is fixed, it just varies from Chinese caliper to caliper. Yes, there are two outputs (data and clock). I will try the shiftin and see what happens...Thanks for your help!!!!!!
best regards,
Nick
www.shumatech.com/support/chinese_scales.htm
BTW, I'm in the process of making my DRO350 from Shumatech for my milling machine using Jenix scales.
Scott has his HEX code for a PIC available for download. Use a disassembler to reverse engineer it to SX?
later, Kevin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 kinds of people in the world.... those that know binary, and those that don't.
I have thusfar used the SX sparingly, since my comfort level with this chip is still building. I hope to have more confidence doing future developments after I tackle this one. Since the Chinese data protocol is not standard serial, there is no reason for me to use PICs. Basically I am modifying Chinese calipers (most expensive at $29.99) 12", 8" and 6" to put a DRO on my 3in1. I have a jumbo 4 x 20 backlit LCD, I will post my code when I get it working.
Best Regards,
Nick
·