Shop OBEX P1 Docs P2 Docs Learn Events
Reading the output from chinese caliper, anybody tried before? — Parallax Forums

Reading the output from chinese caliper, anybody tried before?

EWo_GeEWo_Ge Posts: 20
edited 2008-03-06 12:04 in BASIC Stamp
Hello all -
I'm pretty new to the·BS2 and I try to read the serial output from a cheap caliper.
Has anybody done that before?
A "bread board version" of the interface from 1,5V to TTL is done and seems to work.
I did a search in this forum, but could not find anything.

Any input is appreciated,
thank you very much in advance,
EWo

Comments

  • ForrestForrest Posts: 1,341
    edited 2007-05-14 00:13
    This was discussed on these forum a few weeks ago. Type caliper into the search field here search.parallax.com/
  • EWo_GeEWo_Ge Posts: 20
    edited 2007-05-14 00:21
    I tried exacly that, unfortunatly without success.

    EWo confused.gif
  • EWo_GeEWo_Ge Posts: 20
    edited 2007-05-14 12:19
    Thanks so far for the help.
    OK, here a little more about my project:
    I got a "Micro Mill" from Harbor Freight. Unfortunatly, the thing is in Inches. Since I'm a metric guy (and will always be!) I used some calipers and adapted these to the 3 axis of the machine.
    So far so good, I can read the positions now in mm and inches.
    The next step is to connect a display, where I have my X, Y and Z values shown.
    I have a BS2, which I want to utilize for that purpose.

    Here again my question, this time a little more detailed:
    - would a BS2 be able to do the job?
    - has anybody done it with a BS2?

    Thanks again for any input,
    EWo
    960 x 1280 - 212K
  • PARPAR Posts: 285
    edited 2007-05-14 13:48
    EWo_Ge said...

    I tried exacly that, unfortunatly without success.

    I tried exactly·that also, and got 87 hits. Perhaps you did not go to the right search site, or spell caliper correctly?

    In another posting, you state, "A "bread board version" of the interface from 1,5V to TTL is done and seems to work."

    What does your breadboard circuit do, exactly? How does it work?

    In another posting, you state, "So far so good, I can read the positions now in mm and inches.
    The next step is to connect a display, where I have my X, Y and Z values shown.
    I have a BS2, which I want to utilize for that purpose."

    Where you say "I can read the positions now...", do you mean that your BS2 can read them and display them to your PC screen using a DEBUG statement? Or, do you mean that you can read them when serially input directly from the caliper to your PC general computer? Or, ...???

    PAR
  • EWo_GeEWo_Ge Posts: 20
    edited 2007-05-14 14:12
    The hits I got are all from the SX Microcontroller forum. This would not help me with the programming I need.
    This bread board interface converts the signals from the caliper (1,5V) to TTL level that I can read them with the BS2 inputs. Later I will make a small circuit board, which will have three of this interfaces. For each axis one.
    I can read the values so far on the calipers only, the readout with the BS2 is the current project for which I need some help. I want to read the three calipers with the BS2 and send the data to a serial display.
    I found some descriptions about the protocoll used on these chinese canipers. Its a synchronus serial link with a clock and a data signal. The caliper sends two values: a relative and a absolute position; each 24 bit long.

    EWo
  • PARPAR Posts: 285
    edited 2007-05-14 14:34
    EWo_Ge said...
    The hits I got are all from the SX Microcontroller forum. This would not help me with the programming I need.
    This bread board interface converts the signals from the caliper (1,5V) to TTL level that I can read them with the BS2 inputs. Later I will make a small circuit board, which will have three of this interfaces. For each axis one.
    I can read the values so far on the calipers only, the readout with the BS2 is the current project for which I need some help. I want to read the three calipers with the BS2 and send the data to a serial display.
    I found some descriptions about the protocoll used on these chinese canipers. Its a synchronus serial link with a clock and a data signal. The caliper sends two values: a relative and a absolute position; each 24 bit long.

    EWo
    Let's see if we can nail this down a bit more...

    "This bread board interface converts the signals from the caliper (1,5V) to TTL level that I can read them with the BS2 inputs."

    Are you actually reading them into the BS2? Or, are you saying that you can make the BS2 solicit the caliper's two 24-bit values but don't then know how to actually get those values into the BS2? Or, that you can not do either of those processes?

    If the former, how are you doing that (source code example)? Then, we can go from there to how to display the values.

    ·If the latter, then we've got a starting point to work with for capturing the values; in which case, the next question might be, What is the format (encoding) of those 24 bits --i.e., how are the caliper's numbers (magnitude, decimal place)·represented by those 24 bits.

    PAR
  • RickBRickB Posts: 395
    edited 2007-05-14 14:42
    EWo_Ge

    The BS2 isn't nearly fast enough. Look at the timing diagram shown in this link and note the frequencies involved. You will need an SX or other processor with code written in asm to keep up with the clk and data stream.

    http://www.shumatech.com/support/chinese_scales.htm

    Rick
  • EWo_GeEWo_Ge Posts: 20
    edited 2007-05-14 15:21
    PAR -
    With the converter the BS2 can "see" the signals. My problem is to find some sample of code how to "read" the 24 bit in to numbers.
    But I'm afraid, I will have to look for a different solution anyhow... see Rick's reply

    Rick -
    This answer is not what I was hoping for ...
    I've seen the link you sent before and was hoping that at about 70 - 90 kHz the BS2 can keep up.
    That's a bummer.
    I will probably have to look in to an other controller.

    Thanks anyway,
    EWo
  • EWo_GeEWo_Ge Posts: 20
    edited 2007-05-18 19:11
    Here we go again -
    Rick: you've been right... the BS2 is not fast enough.
    I made a little test; I tried with the COUNT command just to count the clock pulses from the caliper. It should have been 48 pulses per cycle. Already this part failed, which surprised me a little.
    According to the spec the BS2 should be able to count up to 120 KHz. I checked with a scope and and had about 80KHz with a pulse width of about 6 MicroSeconds. The spec says that the minimum width for the BS2 is 4.7 MicroSecs.
    On my quest for a faster processor I looked in to the BS2SX and the SX.
    Here are my questions:
    1. The SX can run with up to 75MHz the BS2-SX with up to 50MHz. Would that be fast enough?
    2. Would it be possible to overclock the BS2-SX to 75MHz?
    3. Would a SX with 75MHz programmed in·SXB OK or is assembler a must? (I HATE ASSEMBLER, 'hated it already on the C64! and that is more than 20 years ago!)

    Thanks again,
    EWo

    Post Edited (EWo_Ge) : 5/18/2007 8:00:34 PM GMT
  • RickBRickB Posts: 395
    edited 2007-05-19 05:42
    The BS2SX is a SX running a basic interpreter. Still not fast enough. The SX with SX/B can do it with ease. SX/B and some small tight inner routines written in asm on a 5-10 MHz sx could also do it. Download SX/B and compile some sample code and look at the resulting asm. Write some code and run it on the simulator. Won't cost you a thing to start developing code for the caliper.

    The reason for poor results with the BS2 is that the pulses from the caliper are not proper ttl/cmos logic levels. They will have to be amplified to about the same levels as the BS2. This is true with the SX also.

    Rick
  • EWo_GeEWo_Ge Posts: 20
    edited 2007-05-19 12:11
    Thanks Rick!
    That helps a lot.

    Its not the signals. As mentioned above, I build a small converter which amplifies the 1.5V signals from the caliper in to TTL. I checked it with a scope and they are as TTL as they can be: 0.15V and 4.85V with a noise level of 0.02V and nice steap flanks. That should not be a problem at all.

    I think, I made up my mind: I'll go with the SX and SX/B.

    Thanks again,
    EWo
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-03-06 12:04
    hello Ewo,

    did you recognize that everything here was written in the Parallax PROPELLER-Forum and NOT in the SX-Forum nor the BS2-forum ?

    The propeller-chip can work at 20 MHz ! per co-processor, And you have 8 of them inside ONE chip !

    http://www.parallax.com/Default.aspx?tabid=407


    there exists a software viewport that is able to read signals up to 20MHz

    so it should be quite easy to read/capture a signal with 80 kHz

    regards

    Stefan
Sign In or Register to comment.