Duet Communicating with Other Boards



  • 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



  • 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".


  • administrators

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



  • 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



  • @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.



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


  • administrators

    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.



  • @dc42 Thanks



  • 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.


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.