how to adjust firmware i/o on sammy c21 analog, pwm, steppers
-
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 -
@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
-
@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.
-
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 -
@handy199
Hi dc42
I will try the instructions pointed out thanks -
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 -
@handy199 there isn't a tutorial.
To add more thermistor inputs you need to:
-
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.
-
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.
- 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:
-
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.
-
In the pin table mark those pins as unavailable. See the existing entries for PA09, PA10 and PA11.
-
Change the value of #define SINGLE_DRIVER from 1 to 0. Also change the value in the line constexpr size_t NumDrivers = 1;.
-
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.
-
-
@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 -
@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)