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

    General Purpose Pin is PWM?

    Scheduled Pinned Locked Moved
    Using Duet Controllers
    4
    10
    496
    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.
    • NeueKlasseundefined
      NeueKlasse
      last edited by NeueKlasse

      after i configured that pin as gpOut[5] in config.g:

      M950 P5 C"io4.out"
      

      it's listed as PWM in the Object model Browser, why that behavior?
      i just want a IO Output to be ON/OFF, 0/5V (to Switch a SSR, not as PWM), or that pins only controlled by PWM?

      T3P3Tonyundefined o_lampeundefined 2 Replies Last reply Reply Quote 0
      • T3P3Tonyundefined
        T3P3Tony administrators @NeueKlasse
        last edited by

        @neueklasse some GPIO output pins support PWM, some do not. the capabilities are listed on the board hardware overview page, e.g.;
        https://duet3d.dozuki.com/Wiki/Duet_3_Mainboard_6HC_Hardware_Overview#Section_IO
        If you do not want to use PWM on the pin then you can just send "0" or "1" in the control commands (for off and on). e.g.

        M42 P5 S1 ; turn on SSR connected to io4 out
        M42 P5 S0 ; turn off SSR connected to io4 out
        

        www.duet3d.com

        NeueKlasseundefined 1 Reply Last reply Reply Quote 0
        • o_lampeundefined
          o_lampe @NeueKlasse
          last edited by

          @neueklasse I guess all GPIO pins have to pass the PWM-planner. You can still use M42 S0 and S255 to switch OFF/ON.

          1 Reply Last reply Reply Quote 0
          • NeueKlasseundefined
            NeueKlasse @T3P3Tony
            last edited by NeueKlasse

            @t3p3tony, @o_lampe

            Thanks for the explanation,

            Another thing that Bothers me:

            My Config.g file has following Lines inside, which sets the Laser to Manual Mode after Startup:

            ; Laser
            M950 F4 C"!out9" Q20000						 		     ; Assign PWM Output out9 to Laser Power Supply on Port 4
            M106 P4 C"Laserpower" S0 X150 H-1						 ; set Laser Power Supply name and maximum PWM value
            M950 P5 C"io2.out"  									 ; Assign Port 5 to io2.out (Laser ON/OFF)
            

            I have to Macros to Set it in Automatic Mode and Manual Mode.

            ; Switch Laser to Automatic Mode
            M950 F4 C"nil"	   							 			 ; free up Pin for Manual Operation
            M950 P5 C"nil"										     ; free up Pin for Manual Operation
            
            M452 C"out9" F20000        						 		 ; Enable Laser mode, on out9 and a PWM frequency of 20000Hz
            ;Use this Control Command for Laser:
            ;Duet 3, RRF 3.x Beta:
            M571 P"io2.out" S1								 		 ; set Output on while extruder is commanded, frequency and value
            
            M117 "Switched to Automatic Mode"
            
            ; Switch Laser to Manual Mode
            M451													 ; Switch to FFF
            M950 F4 C"nil"	   							 			 ; free up Pin for Manual Operation
            M950 P5 C"nil"										     ; free up Pin for Manual Operation
            
            M950 F4 C"!out9" Q20000						 			 ; Assign PWM Output out9 to Laser Power Supply on Port 4
            M106 P4 C"Laserpower" S0 X150 H-1						 ; set Laser Power Supply name and maximum PWM value
            M950 P5 C"io2.out"										 ; Assign Port 5 to io4.out (Laser ON/OFF)
            
            M117 "Switched to Manual Mode"
            

            After Starup i can Set the Lasermode and Activate the "Automatic" Macro
            (Then i get no errors, and the "Laserpower" Fan will be automatically renamed into "Fan 4"
            (which is not a Problem, (maybe possible in the Future to delete Unused Fans in DWC)).

            but if i want to Switch back to Manualmode with the "Manual" Macro i get following Errors:

            LasertoManual.JPG

            Why is this?

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

              @neueklasse which version of RRF are you using?

              www.duet3d.com

              NeueKlasseundefined 1 Reply Last reply Reply Quote 0
              • NeueKlasseundefined
                NeueKlasse @T3P3Tony
                last edited by

                @t3p3tony RRF + DWC Version 3.4.0-b3

                T3P3Tonyundefined dc42undefined 2 Replies Last reply Reply Quote 0
                • T3P3Tonyundefined
                  T3P3Tony administrators @NeueKlasse
                  last edited by

                  @neueklasse i would need to get some input from @dc42 but at a guess there is something preventing leaving laser mode once its set.

                  www.duet3d.com

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

                    @neueklasse in your manual node macro, before you switch out of laser mode with M451 try sending this:

                    M452 C"nil"

                    With luck that will free up the out9 pin.

                    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

                    NeueKlasseundefined 2 Replies Last reply Reply Quote 0
                    • NeueKlasseundefined
                      NeueKlasse @dc42
                      last edited by NeueKlasse

                      @dc42 Thanks, that works for out9 (obviously coupled with the Lasermode)
                      ..for io2.out i made a simple look into the automatic macro... pling....

                      M571 P"nil"
                      

                      and everything works as expected 😉

                      EVERYTHING i assigned in the Automatic Mode Macro needs to be freed up...

                      1 Reply Last reply Reply Quote 1
                      • NeueKlasseundefined
                        NeueKlasse @dc42
                        last edited by NeueKlasse

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