This is a simple Mitutoyo Digimatic interface to use an IDU25E digital gauge to capture readings and send it to Pc. As comercial converters are someway expensive ($200 to $500), I decided to dig and make my own. I'm using BascomAvr as compiler.
The interface works with many other digital gages from Mitutoyo that uses the Digimatic SPC protocol.
The calipers or gages have a 5 pin receptacle. You can get the original connector or weld some wires, but I recommend try to make the connector or buy the cable. The cable ends to a simply IDC10 female so you can use a IDC10 pin header or cut the IDC10 and use one of your predilection. The gage uses only 4 wires.
There are some pics on how to make cable here:
http://easyread-tools.com/Looking the cooper tabs at the caliper, from left to right the pins are numerated as:
1: Ground
2: Data
3: Clock
4: not used
5: /request <--- Warning! Do not pull to more than 1.5V
Because I had it in my drawer, I'm using a ATMega2560 module purchased from Bipom. As it has screw terminals for the ADC inputs, I have configured it as regular Inputs to make my interface. M2560 is a 'huge' resource to do this, so I think a 90S2313 could do the job easily.
Clock and Data can be pulled high to 5V using the internal pullups from the M2560. /Request pin should not be pulled high to 5V, instead I used a NPN transistor to isolate it from the 5V TTL level from the Atmel. If you pull to 5V you could damage your gage, I warn you
From Don Lancaster's Tech Musings #145:
"Your gauge then answers by outputting a 52 bit data sequence. Each clock pulse stays a minimum of 100 microseconds high and then has to remain 100 microseconds low. For a 5 kHz max clock rate. While the data is valid during the entire clock low time, it should get entered into an interface on the rising edge of the clock. Clocking continues until all 52 data bits are output."
You can read the article here
(NOTE: I do not agree with the Fig.1 2x5 header pinout from Don as my cable does not have the pins this way, it simple is wired 1 to 1, 2 to 2, 3 to 3, etc):
http://www.tinaja.com/glib/muse145.pdfThe gage send a 52 bit paket when you pull the /request pin to low. If you keep that pin low, the gage sends the paket repeatdly. So in the firmware I decided to set the /rqst pin low and then wait for the 1st clock pulse to appear, then I release the /Rqst. That way I let the /rqst pin the required time to sent the paket, but just the need time. I read the data whaen clock is low, and that works fine. It needs optimization but it works for now
NOTE: This is not a I2C format because there are no ACK, just a stream of bits.[/i]
The 52 bit paket is divided in to a 13 4-bit BCD. Aditionally, the bytes orde-inverted, LSB is sent first so I had to swap the bits before convert it to BCD-Byte.
I'm using a FootSwitch to trigger the readings. Please add a ceramic capacitor at the switch, in parallel, value 0.1uF to eliminate bounce. My output is at 19,200 using the COM0 RS232 built in on the Bipom module. If you use another stand alone chip, remember to translate the TTL level to RS232 before connecting with the PC!
My output is simply the reading values. If you want to translate it to the format from Mitutoyo Multiplexers, drop a mail