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

how to adjust firmware i/o on sammy c21 analog, pwm, steppers

Scheduled Pinned Locked Moved
Other control boards
3
9
420
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
    handy199
    last edited by 12 Jul 2022, 09:48

    Re: Sammy-C21 increasing analog Input available
    Hi I need to use 6 heaters and thermistors and one servo and two steppers how do I adjust the firmware i/o for the sammy c21 thanks for any help

    undefined undefined 2 Replies Last reply 12 Jul 2022, 11:07 Reply Quote 0
    • undefined
      droftarts administrators @handy199
      last edited by 12 Jul 2022, 11:07

      @handy199 I'm not sure if this is what you mean, but a list of the Sammy C21 pin capabilities is here: https://docs.duet3d.com/Duet3D_hardware/Duet_3_family/Using_the_Sammy-C21_development_board_with_Duet_3#features-of-the-standard-firmware-binary

      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

      1 Reply Last reply Reply Quote 0
      • undefined
        dc42 administrators @handy199
        last edited by dc42 7 Dec 2022, 12:06 12 Jul 2022, 12:05

        @handy199 the firmware for the SammyC21 is in repository https://github.com/Duet3D/Duet3Expansion. Brief instructions for building it can be found there.

        The changes you need to make will mostly be in file src/Config/SAMMYC21.h. Note, all STEP pins should be on the same port, i.e. either on Port A or on Port B.

        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
        • undefined
          handy199
          last edited by 12 Jul 2022, 23:27

          yes can I adjust the pin usage so for 6 thermistors I need 6 analog inputs
          6 heaters 6 pwm outputs for mosfets and one pwm for servo and outputs for two steppers
          I want to use can bus so I don't have a large cable harness going to the x axis so I got the sammy c21 David was at mrrf and we talked about our project and that maybe this board could work I just don't know how to change the firmware
          so any help would be great
          Thanks every one

          undefined 1 Reply Last reply 12 Jul 2022, 23:34 Reply Quote 0
          • undefined
            handy199 @handy199
            last edited by 12 Jul 2022, 23:34

            @handy199
            Hi dc42
            I will try the instructions pointed out thanks

            1 Reply Last reply Reply Quote 0
            • undefined
              handy199
              last edited by 15 Jul 2022, 23:58

              Hi I have every thing loaded can get the firmware up in the ide is there any examples or tutorials that would show me how to add analog inputs for thermistors a stepper motor and a servo to the sammy c21 firmware
              I have never done this before hope you can help us with our project
              thanks so much for any help

              undefined 1 Reply Last reply 16 Jul 2022, 13:15 Reply Quote 0
              • undefined
                dc42 administrators @handy199
                last edited by 16 Jul 2022, 13:15

                @handy199 there isn't a tutorial.

                To add more thermistor inputs you need to:

                1. Identify some spare input pins on the SAMMYC21 that are connected to ADC0. You can see which pins are connected to ADC0 by looking at the SAMC21 data sheet. Alternatively, the pin table in file src/Config/SAMMYC21.h shows that PA04 thru PA08 are uncommitted and connected to ADC0.

                2. In file src/Config/SAMMYC21.h change the following two lines:

                constexpr size_t NumThermistorInputs = 2;
                constexpr Pin TempSensePins[NumThermistorInputs] = { PortAPin(2), PortAPin(3) };

                to account for the additional pins you are using as thermistor inputs.

                1. In the pin table in the same file, alter the lines for the pins you have allocated for additional thermistors, changing the name to "temp2", "temp3" etc. or whatever other name you want to use. You can also set the Exint column to Nx.

                To add more stepper motors:

                1. Allocate an additional STEP, DIR and EN pin for each one (it's possible for all drivers to chare the EN pin, but that's a little more complicated). All STEP pins should be on the same port (A or B), and the existing single stepper driver uses port A; so I suggest you allocate all the STEP pins on port A.

                2. In the pin table mark those pins as unavailable. See the existing entries for PA09, PA10 and PA11.

                3. Change the value of #define SINGLE_DRIVER from 1 to 0. Also change the value in the line constexpr size_t NumDrivers = 1;.

                4. Look for the following lines (not the first set that are within #if USE_CCL, the second set):

                constexpr Pin EnablePins[NumDrivers] = { PortAPin(9) };
                constexpr Pin StepPins[NumDrivers] = { PortAPin(11) };
                constexpr Pin DirectionPins[NumDrivers] = { PortAPin(10) };

                and add the pins for the additional drivers to those lists.

                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
                • undefined
                  handy199
                  last edited by 16 Jul 2022, 14:12

                  @dc42 Thanks I was doing what you said when I saw your reply well all most you pointed out things I had not thought of can I add a servo also
                  thanks for your help your the greatest

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    handy199
                    last edited by 24 Jul 2022, 22:10

                    @dc42 Hi i have adjusted things as needed when I build i get this it may be because I am just changing one file and not the whole project it could also be I have never done this before here is the error I am getting

                    17:48:12 **** Incremental Build of configuration Build (GNU) for project duet3v2 ****
                    make all
                    make: *** No rule to make target 'all'. Stop.
                    "make all" terminated with exit code 2. Build might be incomplete.

                    17:48:12 Build Finished. 0 errors, 0 warnings. (took 117ms)

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