Electronic Circuits and Projects Forum



Digimatic SPC Interface

  1. #1
    sspence65 sspence65 is offline

    Digimatic SPC Interface

    I'm trying to connect a Mitutoyo micrometer to my Arduino m2560. Not able to read any data from the unit. I'm using http://www.sonsivri.com/forum/index.php?topic=29876.0 as the source idea, and am attaching my cable pinouts:

    Mitutoyo Cable.JPG
    Attached Images
    Last edited by sspence65; 13th October 2011 at 07:55 PM. Reason: additional schematic

  2. Thread Starter #2
    sspence65 sspence65 is offline
    Here is the code sample I'm working with:

    Code c:
    int req = 5; //caliper REQ line goes to pin 5
    int dat = 2; //caliper Data line goes to pin 2
    int clk = 3; //caliper Clock line goes to pin 3
    int iclk = 1; //pin 3 corresponds to interrupt number 1
    int i = 0; int j = 0; int k = 0; int n = 0;
     
    int mydata[52];
     
    void setup()
    {
      Serial.begin(19200);
      pinMode(req, OUTPUT);
      pinMode(clk, INPUT);
      pinMode(dat, INPUT);
    }
     
    void loop()
    {
      if (n == 0) attachInterrupt(iclk, myisr, RISING);
        PORTD |= (1<<5); // digitalWrite(req, HIGH);
        delay(10);
        PORTD &= ~(1<<5); // digitalWrite(req, LOW);
        if (i > 51)
        {
          for (j = 0; j < 13; j++)
          {
            Serial.print("--");
            for (k = 0; k < 4; k++)
            {
              Serial.print(mydata[(j*4)+k]);
            }
          }
        i = 0;
        }
    }
     
    void myisr()
    {
      if (i == 0) PORTD |= (1<<5); //digitalWrite(req, HIGH);
      if(i < 52)
      {
        mydata[j] = digitalRead(dat);
        i++;
      }
    }
    0
    Last edited by The Moderation Team; 8th January 2012 at 08:30 AM.

  3. Thread Starter #3
    sspence65 sspence65 is offline
    I got it all working, with a bunch of help from various members of the arduino.cc forum,

    http://arduinotronics.blogspot.com/2...o-arduino.html
    0

Tags
Similar Threads
Thread Starter Forum Replies Last Post
subscriber line interface IC needed waqar Datasheets, Manuals or Parts 1 19th April 2004, 07:23 PM
High-Voltage Interface Needed--Revisited captainkirksdog Electronic Projects Design/Ideas/Reviews 1 11th May 2003, 07:27 AM
High-Voltage Interface Needed captainkirksdog Electronic Projects Design/Ideas/Reviews 3 10th May 2003, 02:30 PM
Digital Panel Meter Interface mark43 Electronic Projects Design/Ideas/Reviews 7 29th March 2003, 08:16 AM
PC-controlled SPC antomurphy Electronic Projects Design/Ideas/Reviews 1 28th January 2003, 05:15 PM
Electronic Circuits  |  Learning Electronics

Join our community with over 100,000 Members! It's free, easy and when you're logged in you have many more features! Click to register.
Page Time: 0.07912 seconds      Memory: 7,253 KB      Queries: 18      Templates: 0