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

Duet Communicating with Other Boards

Scheduled Pinned Locked Moved
General Discussion
5
10
1.9k
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.
  • undefined
    Masock
    last edited by 9 May 2018, 19:54

    I am curious if there is a good way to have a Duet 2 communicate with another board (Say an Arduino)? What pins would I use?

    Reason for doing using a second board other than Duex
    I am building a cabinet in which I am going to put the printer with the Duet. I am planning on a making it have a heated chamber, with several lights, fans, and maybe some servos. When I add up all the PWM pins and everything else I would not have enough between the Duet and a Duex 5. I do plan on running essential fans (like hot end, part, and Duet cooling) of the Duet itself though.

    My Background
    I am a Mechanical engineer with less than 1-year real world experience. I am comfortable building things, but have limited programming experience (C and MATLAB, mostly limited to a Classes and a small “light switch” project). I am more familiar with wiring, but appreciate extra info. I am using this project to learn and grow, as well as to get a nice printer/cabinet combo.

    Thanks,
    Masock

    1 Reply Last reply Reply Quote 1
    • undefined
      Danal
      last edited by 9 May 2018, 21:07

      One early decision: Will your other board "poll" the duet? Or do you expect the duet to "push" events toward the other board? Or some mix?

      For example, the PanelDue is somewhat of mix. It is serial attached, and it sends request/response in some cases, and just "listens" in certain other cases. I point this out, because you could listen to the same serial...

      Anyway, choosing the interface method will guide you to "what pins" and "what board".

      Delta / Kossel printer fanatic

      1 Reply Last reply Reply Quote 0
      • undefined
        dc42 administrators
        last edited by 9 May 2018, 22:12

        You can add 16 additional output pins by connecting a SX1509B I/O expander to the I2C bus.

        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
        • undefined
          Masock
          last edited by 9 May 2018, 22:38

          Danal, for right now I think I could get away with just polling the Duet.

          dc42, I am having a hard time finding SDA and SCL on the Wiring diagram, are the called something different?

          Thanks

          undefined 1 Reply Last reply 9 May 2018, 23:10 Reply Quote 0
          • undefined
            SnowCrash @Masock
            last edited by SnowCrash 5 Oct 2018, 00:33 9 May 2018, 23:10

            @masock said in Duet Communicating with Other Boards:

            dc42, I am having a hard time finding SDA and SCL on the Wiring diagram, are the called something different?

            I've just come across this thread and I would also be very happy to get clarifications on the subject of how the Duet communicates with other boards (I'm working on a similar Duet-compatible expansion board).

            It does seem like the Duet uses I2C to communicate with the DueX2/DueX5 and I believe that SDA & SCL on the Duet are pins 45 (TWD0) & 46 (TDCK0) respectively in the 50-pin expansion connector, though I'd leave it to @dc42 to confirm this of course.

            If you look at the Duex5 schematics on GitHub, you'll see that the SDA & SCL pins on the SX1509B chip are connected to the above-mentioned pins in the Duet (plus the names make sense 🙂 )

            Btw, I've done a lot of coding work with I2C & Arduino in the past, and it seems like our projects are very similar in nature, so if you'd like to collaborate in some way on the development of this interface, I'd be happy to join forces and push this forward.

            Edit: forgot to mention, I noticed it's possible to send I2C commands directly from DWC using gcode (though I haven't tried it myself yet). This could potentially be very useful in that (at least theoretically) a custom micro could be written in which all the back and forth between the Duet and the other board take place.

            1 Reply Last reply Reply Quote 0
            • undefined
              Masock
              last edited by 9 May 2018, 23:38

              @SnowCrash I would be interested in collaborating if there is some way I could be of benefit.

              undefined 1 Reply Last reply 24 May 2018, 00:00 Reply Quote 0
              • undefined
                dc42 administrators
                last edited by 10 May 2018, 10:38

                Yes the I2C pins are TWC0 and TWD0. If you have a DueX5 connected then they are also available on the DueX5 GPIO connector, labelled TWC and TWD. So you can connect a SX1509B-based expander board to those pins. You can get these expander boards from Adafruit and/or Sparkfun.

                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
                • undefined
                  Masock
                  last edited by 10 May 2018, 20:34

                  @dc42 Thanks

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    Biketrial981
                    last edited by 15 May 2018, 16:26

                    another option is to connect an arduino for example to a pwm port and read the value of it. I use it to control my neopixel leds. I handle it servo command, and in the arduino when reading the active values what you need.

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      SnowCrash @Masock
                      last edited by 24 May 2018, 00:00

                      @masock said in Duet Communicating with Other Boards:

                      @SnowCrash I would be interested in collaborating if there is some way I could be of benefit.

                      Hi @masock,

                      I was planning to PM you, but it seems like the forum's interface doesn't support that function (!?)

                      Anyway, I figured I'll respond here as you're probably following this thread. First, sorry for the delay (got called on an urgent project that required a massive time investment).

                      Second, I have a cheeky idea about interfacing with the Duet that I'd like to test out which might save me a lot of work on the planned expansion board. I'll try it out and report back with the results in case it might be helpful for your project too.

                      In the meantime, if you manage to make progress on your side, do post your findings 🙂

                      SnowCrash

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