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

    Duet 2 wifi AND LIS3DH

    Scheduled Pinned Locked Moved
    General Discussion
    5
    33
    700
    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.
    • lucundefined
      luc
      last edited by

      Hi guys, for the connection of a Duet 2 wifi and the LIS3DH accelerometer I am a bit confused as I read different connections between the instructions and some posts of other users.
      In the instructions (https://docs.duet3d.com/en/User_manual/Connecting_hardware/Sensors_Accelerometer) I read:
      Duet LIS3DH
      SDA (MOSI) PIN 5 (MOSI)
      SDO (MISO) PIN 8 (MISO)
      SCL PIN 4
      GND PIN 3

      and I don't seem to have any doubts up to here but for the following I read different connections in various posts than the instructions and I have doubts. How should they be connected?
      CS PIN 1 or PIN 9?
      INT1 PIN 3 or PIN 7?

      Maybe I can connect them as I want but is it enough then to use the correct M955?
      M955 P0 C “spi.cs3+spi.cs1”
      M955 P0 C “spi.cs9+spi.cs7”

      Sorry if this sounds like a stupid question but I couldn't figure it out by myself?
      Thank you

      droftartsundefined 1 Reply Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @luc
        last edited by

        @luc here under the pictures https://docs.duet3d.com/en/User_manual/Connecting_hardware/Sensors_Accelerometer#wiring-schemes it says:

        Note: the pictures above show an alternative wiring scheme, using pin 7 for INT1 and pin 9 for CS on the TEMP_DB connector. We now recommend using pin 1 for CS and pin 3 for INT1 on the TEMP_DB connector.

        The pins relate to the pins on the TempDB connector, pin 9 is SPI_CS4, pin 7 is SPI_CS3:
        f6f6b68d-b242-4563-9b80-f61a99f3c0b6-image.png

        If you have already connected it using pins 9 and 7, you'll need

        M955 P0 C"spi.cs4+spi.cs3"
        

        The main problem with using pins 9 and 7 is that you then can't stack the accelerometer on top of a temperature daughterboard, as there would be no SPI connection.

        Ian

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        lucundefined 1 Reply Last reply Reply Quote 0
        • lucundefined
          luc @droftarts
          last edited by

          @droftarts

          No, I haven't mounted it yet. The accelerometer should arrive on friday and I was studying the situation to prepare the wiring in advance.

          I thank you, it is clearer to me now.

          tasundefined 1 Reply Last reply Reply Quote 0
          • tasundefined
            tas @luc
            last edited by

            @luc Please note GND is on pin 2 of the temperature daughterboard connector, not pin 3 as you listed.

            1 Reply Last reply Reply Quote 0
            • lucundefined
              luc
              last edited by luc

              Yes thank you, I had noticed that.

              This should be the correct connection with the wire colors that I will use:

              Accelerometer / Duet

              Red 3 Volt / PIN 8 + 3,3 cavo rosso
              SDA (MOSI) / PIN 5 SPI_MOSI cavo blu
              SDO (MISO) / PIN 6 SPI_MISO cavo giallo
              SCL / PIN 4 SPI_SCK cavo viola
              GND / PIN 2 GND cavo nero

              CS / PIN 9 SPI_CS4 cavo arancione
              INT1 / PIN 7 SPI_CS3 cavo verde

              droftartsundefined 1 Reply Last reply Reply Quote 0
              • droftartsundefined
                droftarts administrators @luc
                last edited by

                @luc Like I said, it's better to use:

                CS / PIN 1 SPI_CS2 cavo arancione
                INT1 / PIN 3 SPI_CS1 cavo verde

                If you add a temperature daughterboard in the future, you won't have to change the wiring when you plug the accelerometer in on top of the temperature daughterboard, only the configuration.

                Ian

                Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                lucundefined 1 Reply Last reply Reply Quote 0
                • lucundefined
                  luc @droftarts
                  last edited by

                  @droftarts said in Duet 2 wifi AND LIS3DH:

                  @luc Like I said, it's better to use:

                  CS / PIN 1 SPI_CS2 cavo arancione
                  INT1 / PIN 3 SPI_CS1 cavo verde

                  If you add a temperature daughterboard in the future, you won't have to change the wiring when you plug the accelerometer in on top of the temperature daughterboard, only the configuration.

                  Ian

                  Yeah, yeah...okay, thank you.

                  1 Reply Last reply Reply Quote 0
                  • lucundefined
                    luc
                    last edited by

                    Here I am again!

                    Continuing to study the settings, I arrived at the M955 setting.
                    From what I understand in config.g I enter:

                    M955 P0 C “spi.cs4+spi.cs3” (change cs4 and cs3 if I use different pins)

                    But I also need to set the orientation (which for me will follow the axis orientation) so I add:
                    M955 P0 I20

                    I am not clear if I also have to add the S and R paramenters so it becomes:
                    M955 P0 I20 S5000 R10 ?

                    jay_s_ukundefined 1 Reply Last reply Reply Quote 0
                    • jay_s_ukundefined
                      jay_s_uk @luc
                      last edited by

                      @luc no need to mess with S and R so don't include them

                      Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                      lucundefined 1 Reply Last reply Reply Quote 0
                      • lucundefined
                        luc @jay_s_uk
                        last edited by

                        @jay_s_uk Okay, thank you.
                        So do I just use M955 P0 I20 or not even that which seems to me that by default it considers it oriented according to the axis direction of the sensor?

                        jay_s_ukundefined 1 Reply Last reply Reply Quote 0
                        • jay_s_ukundefined
                          jay_s_uk @luc
                          last edited by

                          @luc you'll probably need to adjust the I value once you get it installed and work out which way its pointing

                          Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                          1 Reply Last reply Reply Quote 0
                          • lucundefined
                            luc
                            last edited by

                            Connected as per the description above. The acelerometer led is on green.

                            Entered the following string in config.g:
                            M955 P0 C “spi.cs4+spi.cs3”

                            I try to send M955 and get the following message:

                            Error: M955: missing parameter 'P'

                            I read the guidea and for the connection type it seems to me that P0 is correct. What am I doing wrong?

                            tasundefined droftartsundefined 2 Replies Last reply Reply Quote 0
                            • lucundefined
                              luc
                              last edited by

                              Despite the error in my previous post I tried to see if it worked and it did....did the first test.
                              I attach the image and I would like to know from you who are experts what you think. I got an idea nma would like your opinion. Thank you

                              Immagine 2025-04-04 141222.jpg

                              1 Reply Last reply Reply Quote 0
                              • tasundefined
                                tas @luc
                                last edited by

                                @luc That is the hardware wiring part of M955. You must also tell Duet the communication settings.

                                ;M955 P0 C"spi.cs4+spi.cs3";LIS3DH
                                ;M955 P0 I25 S1344 R10  ; S1344 is 1344Hz sample rate.  R10 is 10 bit resolution for LIS3DH.
                                
                                

                                You can enter all of the parameters on one line if you like.

                                Make sure to check your orientation for the I parameter and insert the appropriate two numbers.

                                lucundefined 1 Reply Last reply Reply Quote 0
                                • lucundefined
                                  luc @tas
                                  last edited by

                                  @tas said in Duet 2 wifi AND LIS3DH:

                                  M955 P0 I25 S1344 R10 ; S1344 is 1344Hz sample rate. R10 is 10 bit resolution for LIS3DH.

                                  Thank you for your response.
                                  I added M955 P0 I20 S1344 R10 but if I send m955 I always get: Error: M955: missing parameter 'P'

                                  tasundefined 2 Replies Last reply Reply Quote 0
                                  • tasundefined
                                    tas @luc
                                    last edited by

                                    @luc You have to send M955 P0. Sorry early in the day for me! There are defaults for the other settings which is why it works for you.

                                    lucundefined 1 Reply Last reply Reply Quote 0
                                    • tasundefined
                                      tas @luc
                                      last edited by

                                      @luc Also I should have removed the semicolons in front of each line before posting the code. I now use another acclerometer.

                                      1 Reply Last reply Reply Quote 0
                                      • lucundefined
                                        luc @tas
                                        last edited by

                                        @tas
                                        OK...It's ok. Now with m955 po no longer gives error and responds with parameters

                                        many thanks

                                        1 Reply Last reply Reply Quote 0
                                        • droftartsundefined
                                          droftarts administrators @luc
                                          last edited by

                                          @luc said in Duet 2 wifi AND LIS3DH:

                                          Entered the following string in config.g:
                                          M955 P0 C “spi.cs4+spi.cs3”

                                          Make sure you are using straight quote marks, not curly quote marks, ie the above should be

                                          M955 P0 C"spi.cs4+spi.cs3"
                                          

                                          I try to send M955 and get the following message:
                                          Error: M955: missing parameter 'P'

                                          What firmware version are you using? Send M122 and post the response.

                                          Ian

                                          Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                                          lucundefined 1 Reply Last reply Reply Quote 0
                                          • lucundefined
                                            luc @droftarts
                                            last edited by

                                            @droftarts said in Duet 2 wifi AND LIS3DH:

                                            @luc said in Duet 2 wifi AND LIS3DH:

                                            Entered the following string in config.g:
                                            M955 P0 C “spi.cs4+spi.cs3”

                                            Make sure you are using straight quote marks, not curly quote marks, ie the above should be

                                            M955 P0 C"spi.cs4+spi.cs3"
                                            

                                            I try to send M955 and get the following message:
                                            Error: M955: missing parameter 'P'

                                            What firmware version are you using? Send M122 and post the response.

                                            Ian
                                            All ok, thank you too!

                                            The first test performed is what I insierite a few posts above.

                                            Can you give me your opinion on the result?

                                            Is there a document to read that explains how to interpret the values?

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