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

Duet 2 wifi AND LIS3DH

Scheduled Pinned Locked Moved
General Discussion
5
33
682
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.
  • undefined
    luc
    last edited by 2 Apr 2025, 12:34

    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

    undefined 1 Reply Last reply 2 Apr 2025, 13:08 Reply Quote 0
    • undefined
      droftarts administrators @luc
      last edited by 2 Apr 2025, 13:08

      @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

      undefined 1 Reply Last reply 2 Apr 2025, 14:05 Reply Quote 0
      • undefined
        luc @droftarts
        last edited by 2 Apr 2025, 14:05

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

        undefined 1 Reply Last reply 2 Apr 2025, 14:24 Reply Quote 0
        • undefined
          tas @luc
          last edited by 2 Apr 2025, 14:24

          @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
          • undefined
            luc
            last edited by luc 4 Feb 2025, 14:52 2 Apr 2025, 14:50

            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

            undefined 1 Reply Last reply 2 Apr 2025, 15:19 Reply Quote 0
            • undefined
              droftarts administrators @luc
              last edited by 2 Apr 2025, 15:19

              @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

              undefined 1 Reply Last reply 2 Apr 2025, 16:34 Reply Quote 0
              • undefined
                luc @droftarts
                last edited by 2 Apr 2025, 16:34

                @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
                • undefined
                  luc
                  last edited by 3 Apr 2025, 05:29

                  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 ?

                  undefined 1 Reply Last reply 3 Apr 2025, 05:42 Reply Quote 0
                  • undefined
                    jay_s_uk @luc
                    last edited by 3 Apr 2025, 05:42

                    @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

                    undefined 1 Reply Last reply 3 Apr 2025, 05:47 Reply Quote 0
                    • undefined
                      luc @jay_s_uk
                      last edited by 3 Apr 2025, 05:47

                      @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?

                      undefined 1 Reply Last reply 3 Apr 2025, 06:01 Reply Quote 0
                      • undefined
                        jay_s_uk @luc
                        last edited by 3 Apr 2025, 06:01

                        @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
                        • undefined
                          luc
                          last edited by 4 Apr 2025, 11:50

                          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?

                          undefined undefined 2 Replies Last reply 4 Apr 2025, 12:18 Reply Quote 0
                          • undefined
                            luc
                            last edited by 4 Apr 2025, 12:15

                            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
                            • undefined
                              tas @luc
                              last edited by 4 Apr 2025, 12:18

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

                              undefined 1 Reply Last reply 4 Apr 2025, 12:27 Reply Quote 0
                              • undefined
                                luc @tas
                                last edited by 4 Apr 2025, 12:27

                                @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'

                                undefined 2 Replies Last reply 4 Apr 2025, 12:30 Reply Quote 0
                                • undefined
                                  tas @luc
                                  last edited by 4 Apr 2025, 12:30

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

                                  undefined 1 Reply Last reply 4 Apr 2025, 12:35 Reply Quote 0
                                  • undefined
                                    tas @luc
                                    last edited by 4 Apr 2025, 12:31

                                    @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
                                    • undefined
                                      luc @tas
                                      last edited by 4 Apr 2025, 12:35

                                      @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
                                      • undefined
                                        droftarts administrators @luc
                                        last edited by 4 Apr 2025, 12:35

                                        @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

                                        undefined 1 Reply Last reply 4 Apr 2025, 13:07 Reply Quote 0
                                        • undefined
                                          luc @droftarts
                                          last edited by 4 Apr 2025, 13:07

                                          @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?

                                          undefined 1 Reply Last reply 4 Apr 2025, 13:19 Reply Quote 0
                                          3 out of 33
                                          • First post
                                            3/33
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA