Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Intercepting step/dir with an Arduino

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    3
    5
    252
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Eumldeumlundefined
      Eumldeuml
      last edited by

      Hi all! 🙂
      I'm trying to read the signals coming from the E2_STEP and E2_DIR pins on the expansion header with an Arduino. For every step pulse while DIR is high I want to increment a counter and for every step pulse while DIR is low it is decremented.
      The problem I encountered is that the DIR pin doesn't have either a high or low state but instead just sends a positive/negative spike for each direction change. I checked this with an oscilloscope.
      Is this the expected behaviour? From what I've read the DIR pin should either be constantly low or high.

      Btw, I know that the Arduino Mega uses 5V logic and the Duet WiFi outputs 3.3V at the expansion header but for now this doesn't seem like a problem.

      A Former User? dc42undefined 2 Replies Last reply Reply Quote 0
      • A Former User?
        A Former User @Eumldeuml
        last edited by

        @Eumldeuml said in Intercepting step/dir with an Arduino:

        I checked this with an oscilloscope.

        which settings did you use for the scope?

        1 Reply Last reply Reply Quote 0
        • dc42undefined
          dc42 administrators @Eumldeuml
          last edited by

          @Eumldeuml said in Intercepting step/dir with an Arduino:

          From what I've read the DIR pin should either be constantly low or high.

          That's correct, it should only change when there is a direction change. Are you sure you are not looking at the STEP pin instead?

          Duet WiFi hardware designer and firmware engineer
          Please do not ask me for Duet support via PM or email, use the forum
          http://www.escher3d.com, https://miscsolutions.wordpress.com

          1 Reply Last reply Reply Quote 0
          • A Former User?
            A Former User
            last edited by

            wouldn't the step pin just be a series of high pulses and not negative?

            sounds to me like hes viewing the dir signal ac-coupled?

            1 Reply Last reply Reply Quote 0
            • Eumldeumlundefined
              Eumldeuml
              last edited by

              Regarding the settings for the scope, I'm not sure which ones you mean.
              The step pulses are what you'd expect but the DIR signal is not. On the picture you can see both signals, STEP on top, DIR below. The sampling rate probably isn't high enpugh to catch all the pulses (pulse width is set to 2 µs) but otherwise you wouldn't be able to see the whole spike on the DIR channel.
              20200805_115209.jpg

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA