Shop OBEX P1 Docs P2 Docs Learn Events
Digital Calipers — Parallax Forums

Digital Calipers

Macgman2000Macgman2000 Posts: 59
edited 2005-10-18 22:03 in General Discussion
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
·

Comments

  • BeanBean Posts: 8,129
    edited 2005-10-18 17:20
    Sounds like SHIFTIN is what you need. Check out the SX/B help file.
    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."
    ·
  • pjvpjv Posts: 1,903
    edited 2005-10-18 17:54
    Hi Nick;

    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)
  • BeanBean Posts: 8,129
    edited 2005-10-18 18:09
    Nick,
    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."
    ·
  • Macgman2000Macgman2000 Posts: 59
    edited 2005-10-18 18:29
    Hello,

    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
  • mojorizingmojorizing Posts: 249
    edited 2005-10-18 18:40
    Here's a good explanation of the output from a chinese scale

    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.
  • Macgman2000Macgman2000 Posts: 59
    edited 2005-10-18 22:03
    ·I am making an effort to use the SX·chip and·SX/B to streamline my development time. As far as PIC, I have used them extensively in the past. I use them whenever I need to use special hardware (USART, 10bit ADC·or PWM output), since what they lack in horsepower is offset by offloading to built in peripherals.

    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

    ·
Sign In or Register to comment.