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

    Additional outputs using a SX1509B Expander

    Scheduled Pinned Locked Moved
    Accessories and Add-ons
    4
    20
    1.3k
    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.
    • t0biasundefined
      t0bias
      last edited by

      I may be wrong, but I think pull-up resistors can only be enabled on ports of the Duet board itself.
      There are source-files specifically for this expansion chip (here), however I have no idea what the "DuetNG" denomination is about to be honest. Also, this branch seems to be of the 2.x firmware only?

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

        @t0bias, which firmware version are you using? In particular, part of that code was rewritten between versions 3.2.2 and 3.3beta1, so what works in one might not work in the other.

        I can increase the number of available GpOut ports in the next 3.3beta. Would 20 be sufficient?

        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
        • t0biasundefined
          t0bias
          last edited by

          @dc42 thanks for your reply. I am using version 3.1.1, would a upgrade fix the issue?
          yes, 20 would be sufficient, maybe a bit more would be even better still? 😉

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

            @t0bias said in Additional outputs using a SX1509B Expander:

            @dc42 thanks for your reply. I am using version 3.1.1, would a upgrade fix the issue?

            An upgrade to 3.3beta1 might possibly fix it, if it doesn't then let me know and I'll implement a fix in 3.3beta2.

            yes, 20 would be sufficient, maybe a bit more would be even better still? 😉

            Memory is rather tight on the Duet 2, so I'll set it to 20 in 3.3beta2. It's already 32 on Duet 3 and 3 Mini.

            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
            • t0biasundefined
              t0bias
              last edited by

              I upgraded to 3.3beta1 today, but it still doesn't work unfortunately

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

                Thanks, this is on my list to test/investigate.

                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
                • dc42undefined
                  dc42 administrators
                  last edited by dc42

                  I have just tested this, and ports sx1509b.0, .1 and .2 all work for me using RRF 3.2.2 and also using RRF 3.3beta1. I didn't test the other ports.

                  Points to note:

                  1. M115 will report the SX1509B if it is detected:
                  04/03/2021, 11:17:06 	m115
                  FIRMWARE_NAME: RepRapFirmware for Duet 2 WiFi/Ethernet FIRMWARE_VERSION: 3.3beta1 ELECTRONICS: Duet WiFi 1.02 or later + DueX5 + SX1509B expander FIRMWARE_DATE: 2021-02-14 16:00:49
                  
                  1. My test system includes a very old DueX5. On these old boards, the TWC and TWD pins are labelled the wrong way round on the 10-pin expansion header. They are also labelled incorrectly on the wiring diagrams at https://duet3d.dozuki.com/Wiki/Duex_wiring_diagrams for the 0.6 and 0.7 boards. On all DueX revisions, TWC (aka SCL) is next to the ground pin at the end of the header.

                  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
                  • t0biasundefined
                    t0bias
                    last edited by

                    Strange, the SX1509B is in fact detected:

                    FIRMWARE_NAME: RepRapFirmware for Duet 2 WiFi/Ethernet FIRMWARE_VERSION: 3.3beta1 ELECTRONICS: Duet WiFi 1.02 or later + SX1509B expander FIRMWARE_DATE: 2021-02-14 16:00:49
                    

                    however the pins don't get driven high (or low) using the M42 commands.
                    I am confident the I²C-Wiring is correct, since I tried using a MCP23017 based relay board that responds to I²C-Commands just fine.

                    Any suggestions or ideas are highly appreciated!

                    DIY-O-Sphereundefined dc42undefined 2 Replies Last reply Reply Quote 0
                    • DIY-O-Sphereundefined
                      DIY-O-Sphere @t0bias
                      last edited by DIY-O-Sphere

                      @t0bias
                      Have you checked the I2C address?
                      It has to be set to 0x71

                      Here some code to test it directly with M260
                      https://forum.duet3d.com/topic/13911/sx1509-on-maestro-does-it-work/3

                      (UTC+1)

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

                        @t0bias, if the board is detected then the I2C pins are connected correctly and the slave address is set correctly.

                        How are you testing the outputs of the SX1509B? I have connected each output through a 100 ohm resistor to one of the cathodes of a 2-digit common anode 7-segment display, with the anodes connected to +3.3V.

                        2021-03-09 21.15.43.jpg

                        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
                        • First post
                          Last post
                        Unless otherwise noted, all forum content is licensed under CC-BY-SA