Reading the output from chinese caliper, anybody tried before?
EWo_Ge
Posts: 20
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
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
EWo
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
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
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
"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
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
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
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
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
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
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