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

    CAN development possibilities

    Scheduled Pinned Locked Moved
    Hardware dev
    3
    6
    483
    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.
    • hauschkaundefined
      hauschka
      last edited by

      Hey everyone,

      I'm looking into ways of connecting/building my own toolboards and also to explore what's possible with CAN-FD on the Duet 3!

      I recently followed the documentation on the sammy-c21 boards and so far I understood that the board has pins available, but I don't understand how I could include these pins in gcode.

      For example, there's a pin called pa04, would I then set its PWM to 50% by calling :

      M950 P0 C"XX.pa04" Q500
      and
      M42 P0 S0.5
      ?

      Is it possible to save functions on the chip and then call the whole functions via gcode?

      Same goes for Arduino! The CanDIY shield looks really nice, but I'm quite unsure how to use it.

      Would I be able to call subroutines that execute arduino code and once it's done return to the "main printjob"?

      Does anyone have an overview of what's possible and what's not?

      Looking forward to some input from everyone 🙂

      dc42undefined 1 Reply Last reply Reply Quote 0
      • T3P3Tonyundefined
        T3P3Tony administrators
        last edited by

        Have you tried the method you outlined:

        For example, there's a pin called pa04, would I then set its PWM to 50% by calling :

        M950 P0 C"XX.pa04" Q500
        and
        M42 P0 S0.5

        www.duet3d.com

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

          @hauschka said in CAN development possibilities:

          For example, there's a pin called pa04, would I then set its PWM to 50% by calling :

          M950 P0 C"XX.pa04" Q500
          and
          M42 P0 S0.5
          ?

          Yes you can do that, although I can't remember offhand whether port PA04 supports PWM.

          Is it possible to save functions on the chip and then call the whole functions via gcode?

          Unless you extend the CAN protocol, you would need to use an existing CAN message. For example, you could alter that code so that M42 commands to a particular port ran your function.

          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

          hauschkaundefined 1 Reply Last reply Reply Quote 0
          • hauschkaundefined
            hauschka @dc42
            last edited by

            Thanks a lot for those answers!

            Unless you extend the CAN protocol, you would need to use an existing CAN message. For example, you could alter that code so that M42 commands to a particular port ran your function.

            Are the "existing/available CAN messages" documented somewhere?

            I would expect them to be in CANlib ?

            Where/ How would I modify the protocol?
            Would I have to add a custom M-code with the function's name in it?

            @dc42 any guidance is highly appreciated! 🙂

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

              Yes they are documented in CANLib. An overview of the CAN protocol is at https://github.com/Duet3D/CANlib/blob/master/doc/Duet 3 CAN protocol.odt, the message type numbers are in https://github.com/Duet3D/CANlib/blob/master/src/CanId.h, and the formats of the messages in https://github.com/Duet3D/CANlib/blob/master/src/CanMessageFormats.h.

              Currently there is no provision for user-defined messages, but I may add a few for users such as yourself to use.

              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

              hauschkaundefined 1 Reply Last reply Reply Quote 0
              • hauschkaundefined
                hauschka @dc42
                last edited by

                @dc42 said in CAN development possibilities:

                Currently there is no provision for user-defined messages, but I may add a few for users such as yourself to use.

                That would be really cool!
                I'm not familiar with C++, unfortunately 😞

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