PDA

View Full Version : Chinese Calipers



anj
- 20th November 2006, 08:13
Gday All

I have been playing around with a set of cheap Chinese digital calipers.
I have found a few articles setting out how to read the data
and also how to use the data and clock lines to set the mode.
I have all this working via the parallel port on my PC, but only just, due to the read time granularity.
I want to look at getting a PIC 16F88 to do this for me
I have only seen one post re this, and it highlights the prob i found
The calipers i have use a 60uS preamble, 24 clocks of ~13us, a 110us seperator, 24 clocks of 13us and a 55uS terminator.
This is repeated every 200mS or so.
Shiftin is limited to 50Kz and my logic analyser results show the unit is running at about 77Khz when clocking data
Hence whats the best way ( in PicBasicPro ) to do this.
I am a mug at assembler and a semi mug when it comes to interrupts.
( Which is why i bought PicBasicPro )
I have read what i should look at is an interrupt on the falling edge of the clock, then triple sample the data and average, to remove glitches
But if i use an interrupt to detect the preamble, how do i reinterrupt on each falling edge till i register the reqd 48 bytes of data
I'm sure its simple, but i'm not seeing it.

Andrew