Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ramps 1.4.4 to AGCM4 #16606

Merged
merged 7 commits into from
Feb 14, 2020
Merged

Add ramps 1.4.4 to AGCM4 #16606

merged 7 commits into from
Feb 14, 2020

Conversation

GMagician
Copy link
Contributor

@GMagician GMagician commented Jan 18, 2020

Adding first shield to AGCM. I Hope to put my hands on it as soon as @MrAlvin will be ready and to finally test a real system

@MrAlvin if you have some time please validate pinout

N.B. current SAMD framework has an issue with usb serial and Marlin will "forget" some chars when send to host. Fix has been already merged into new adafruit framework, but PlatformIO has not been updated yet

It seems that now adafruit/platformio has switched from TINYUSB to USBCON then above statement is no more relevant

Marlin/Configuration.h Outdated Show resolved Hide resolved
@MrAlvin
Copy link

MrAlvin commented Jan 20, 2020

Hi @GMagician,
good to see that you are still going strong.

I am not quite sure how to follow up on this request. But I think you would like me to look at the pin assignments where there are question marks, correct?

@MrAlvin
Copy link

MrAlvin commented Jan 20, 2020

I am not sure how to verify these three.

For the RAMPS 1.4.4 shield, the software pins going to the TMC2130 drivers, are the same pins as the hardware pins. So I would think that they need to be:
MOSI 51
MISO 50
SCK 52
(as also indicated by this page: https://www.arduino.cc/en/reference/SPI )

Unless you choose to add Dupont wires to the top of the stepper drivers. And then it is possible to use any available pins.

#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI 51 //?66
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO 50 //?44
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK 52 //?64
#endif
#endif

@MrAlvin
Copy link

MrAlvin commented Jan 20, 2020

About:
#ifndef X_SERIAL_TX_PIN
#define X_SERIAL_TX_PIN ?40
#endif
#ifndef X_SERIAL_RX_PIN
#define X_SERIAL_RX_PIN ?63
#endif

Is it still necessary to define two pins for Rx/Tx to the 220x PDN UART signal?

I would suggest to wait with assignments, until it is possible to use only one MCU pin for 220x UART communication.

A general note about which MCU pin to use for PDN UART with the 220x drivers.

As I understand, then It is not universally defined which pin is the PDN pin (UART pin) on the 220x step-stick boards/revisions of the boards.

[Edit]
Examples of how PDN is implemented on different StepStick designs is collected here:
https://reprap.org/wiki/TMC2209
[/Edit]

But is seems that the newest 220x step-stick boards have an option to chose between some pins going to the shield, for the PDN signal, so I would suggest to use the pin that is otherwise used for CS on the TMC2130 drivers, as it is easy to connect that pin from the step-stick boards to a MCU pin, via the RAMPS 1.4.4 shield.

[Edit]
The CS pin is otherwise also known as the MS3 pin
[/Edit]

This would result in the following definitions:
X_PDN 47
Y_PDN 45
Z_PDN 32
E0_PDN 22
E1_PDN 43

For some MCU's it might however not be possible/feasable to use those pins as a universal one-wire Rx/Tx Uart software solution, as it might be necessary to be able to attach an interrupt routine to the MCU pin used.

I am not sure if the AGCM4 board has interrupt abilities on these pins.

[Edit]
It seems like both the Due and the AGCM4 MCUs have an option to have an interrupt associated with any pin on the chip
[/Edit]

[Edit]
Provisions are also now made on the shield, so it might be possible to use either pin D47 or pin D66 as a Single SoftwareSerial for up to four TMC2209 drivers.
[/Edit]

@MrAlvin
Copy link

MrAlvin commented Jan 20, 2020

About // LCDs and Controllers //

I only have access to the
RepRapDiscount Smart Controller
and the
RepRapDiscount FULL GRAPHIC Smart Controller
so they are the only LCDs that I have verified to work with the RAMPS 1.4.4 shield.

But as AUX-1, AUX-2 AUX-3 and AUX-4 are the same as the original RAMPS 1.4 shield, the other LCD solutions/definitions should still work the same, and would typically use the same pin assignments as the pins_RAMPS_14.h files has defined them.

Additionally I am however also preparing an LCD adapter board with a built in I2C MCP23017 chip, and this LCD adapter is intended to be usable in combination with LCDs that use the EXP-1 and EXP-2 sockets, so I will also be giving the I2C LCD options some attention, at a later date.

The purpose of this new LCD adapter board is, to free some pins on AUX-4, so it becomes possible to control more stepper drivers (or something else) from a RAMPS based setup.

@MrAlvin
Copy link

MrAlvin commented Jan 20, 2020

@GMagician Did these comments clear up some of your questions?

Also, I am right now soldering the shield that is intended to be shipped to you. Ok?

@GMagician
Copy link
Contributor Author

GMagician commented Jan 20, 2020

@MrAlvin thanks for your support, you are right about why I involved you.

About mosi: I'll define here default pins. Pin 50, 51, 52 are SPI bus and, on AGCM4, are the same H/W pins connected to "central connector". Adafruit has also named these pin with different numbering then depending on where ramps is connected to I would use proper numbers (I know this is just a pedantry).
About 220x UART: SAMD51 uses a 'sercom' module to handle all serial buses (I2C, SPI, UART) so to properly handle UART for 220x stepstick only its dedicated pin needs to be connected (otherwise a soft uart handling must be written). Now SPI is also used by LCD SD (don't know if also used by some LCD themselves) so I think that 220x stepsticks will require different pins to be used in UART mode. I may decide to not define "defaults" for them.
About your LCD: Better to share SD SPI for it (and a different CS pin) so that both AGCM4 and DUE may use H/W spi instead of soft one
Edit: I re-read your post. Your LCD works with i2c, not spi...ok

@GMagician
Copy link
Contributor Author

GMagician commented Jan 20, 2020

@MrAlvin

Also, I am right now soldering the shield that is intended to be shipped to you. Ok?

ok, please don't solder stepper, endstops, thermistores, dupont headers, I will replace them (where possible) with 5120 ones.

Edit: PM me to details about this

@GMagician
Copy link
Contributor Author

GMagician commented Jan 20, 2020

@MrAlvin please take also a look to other defined pins, just to be sure they are correct (please take care of different analog pins numbering AGCM4 has when they are used as digital)

@GMagician GMagician changed the title Add ramps 1.4.4 to SAMD51 Add ramps 1.4.4 to AGCM4 Jan 20, 2020
@GMagician
Copy link
Contributor Author

@MrAlvin I changed almost all pins to AGCM4, even soft UART (they are on aux2 and you said this connector is compatible with ramps).

Only doubt is SDSS and SPI (TMC spi). Where are they connected? To central connector, to 50-52 or free (solder/jumper needed)

@MrAlvin
Copy link

MrAlvin commented Jan 20, 2020

@GMagician I have sent you a PM, and included schematics and PCB design files.
And I see that you have already been very fast and have updated your Marlin files. Way to go :-)

@GMagician
Copy link
Contributor Author

GMagician commented Feb 9, 2020

Updates:
I tested my lcd and its SD card and they are working
I tested onboard SD card and it's working
I tested fans and they are working
I tested hotend and bed they are working
I tested thermistores and they are working (when other AGCM4 PR will be merged)
I tested eeprom and it's working
Endstop are not working but I cant' find where issue is coming from..investigating
Servos not tested yet
Stepper not tested

@GMagician
Copy link
Contributor Author

GMagician commented Feb 9, 2020

Endstop are not working but I cant' find where issue is coming from..investigating

this seems a ramps hardware issue. @MrAlvin already found out how to solve it

@GMagician
Copy link
Contributor Author

@thinkyhead I don't have any bltouch 3.3V so I can't test servos part. It may not works since has been developped using original servo lib (at the time of developping original lib wasn't working at all on samd51), also stepper, I need to implement SoftwareSerial but I still don't have any tmc2208/2209 (I have to buy one to do tests), nor I have tmc2130 or any free stepstick (I have only drv8825 but are connected to my printer). No step motors (only on printer)

Everything else is now working (endstops issue was hardware cause)

GMagician and others added 7 commits February 11, 2020 18:04
Swapped E0 with E1 pins
Renamed E1 to Z2 since without hotend E1 is useless
Use stepsticks CS as soft serial TX/RX
Add correct onboard SD handling
@GMagician
Copy link
Contributor Author

@thinkyhead I think this can be merged now. Tested servo (connected bl-touch without input) all commands are working as expected.

@thinkyhead
Copy link
Member

Great, thanks for keeping it moving forward. I'll give it a once-over review now….

@thinkyhead thinkyhead merged commit ff0c931 into MarlinFirmware:bugfix-2.0.x Feb 14, 2020
@GMagician GMagician deleted the Ramps144 branch February 14, 2020 08:43
StJa added a commit to StJa/Marlin that referenced this pull request Mar 9, 2020
* Add sanity-check for new Advanced Pause option

Followup to MarlinFirmware#16372

* Include macros for delta ABC

* Update Russian language (MarlinFirmware#16745)

* Fix BTT SKR 1.4 extra endstop pins (MarlinFirmware#16738)

* Option for Trigorilla 1.4 with add-on endstops board (MarlinFirmware#16737)

* Consistent M112 with Emergency Parser (MarlinFirmware#16747)

* Improve mfadd helper script

- Use the original branch name if none is supplied
- Set the remote tracking to the source
- Accept User/Branch or User:Branch syntax

* Clean up i2c encoder, sanitize serial

* Misc cleanup, whitespace

* Encapsulate probe as singleton class (MarlinFirmware#16751)

* G34 automatic point assignment (MarlinFirmware#16473)

* Fix Temperature::over_autostart_threshold (MarlinFirmware#16749)

* Update Russian language (MarlinFirmware#16750)

* Fix CURRENT_STEP_DOWN compile error

* Drop obsolete SD special char handling

See MarlinFirmware#14035

* Probe singleton patch

Followup to MarlinFirmware#16751

* Fix RGB / Neopixel white color bug

See MarlinFirmware#16752

* Suppress a compile warning

* More 8-extruder fixups

* Add EXP labels to SKR pins

* Fix LPC build with USE_WATCHDOG off

* Minor string storage optimization

* Apply REPEAT, RREPEAT, and loop macros (MarlinFirmware#16757)

* Revert breaking change to _FAN_PWM macro

* Add Z_AFTER_HOMING to raise Z more in G28 (MarlinFirmware#16755)

* Corner Leveling: Add inset for each side (MarlinFirmware#16759)

* (c) 2020

* Tweak mfqp script

* Use a different Configurations branch for CI

* Fix LCD Z Move character LCD display line (MarlinFirmware#16772)

* Fix warning for ESP32 (MarlinFirmware#16771)

* [cron] Bump distribution date

* Force T0 in UBL G29 on all multi-hotend setups (MarlinFirmware#16774)

* Keep secure credentials in a separate config file (MarlinFirmware#16773)

* STM32duino - Use SDIO for onboard SD (MarlinFirmware#16756)

* Fix E stepper stays on bug

Fixes MarlinFirmware#16753

* Fix Arduino IDE compile for DUE

Fixes MarlinFirmware#16767

* Fix CALIBRATION_GCODE pin handling

* Upgrade an ifdef

* More updates for 8 extruders, REPEAT

* [cron] Bump distribution date (2020-02-05)

* Add MKS Base 1.6 board (MarlinFirmware#16783)

* Direct download link for configs

* [cron] Bump distribution date (2020-02-06)

* Split up MKS_RUMBA32 into two variants (MarlinFirmware#16781)

* G26: Allow to set retraction for UBL mesh test (MarlinFirmware#16511)

* Remove extraneous Serial init (MarlinFirmware#16794)

* Fix probe with multi-endstops (MarlinFirmware#16793)

* [cron] Bump distribution date (2020-02-07)

* [cron] Bump distribution date (2020-02-08)

* Clean up Makefle indentation

* Add .editorconfig file

* Tweak ABL logging, document probing

* [cron] Bump distribution date (2020-02-09)

* Coolstep for TMC2130, 2209, 5130, 5160 (MarlinFirmware#16790)

* Better probe fail handling (MarlinFirmware#16811)

* Adafruit Grand Central M4 fixes (MarlinFirmware#16812)

* Minor HAL cleanup

* Move MSG_MARLIN

* Show print time with PRINTER_EVENT_LEDS

* Tweak parser warning

* Bump config version to 020004 (MarlinFirmware#16816)

* Add PID, probe offsets to ExtUI (MarlinFirmware#16792)

* [cron] Bump distribution date (2020-02-10)

* Tweak LPC1768 upload py script

* Add mftest -b (auto-build) and -u (upload)

- Implement the equivalent of auto-build for the shell environment by using the MOTHERBOARD setting to look up the env: entries.

* Revert change to AXIS_DRIVER_TYPE_X2

- Revisit this to figure out why it breaks

* Revert "Coolstep for TMC2130, 2209, 5130, 5160"

Reverting MarlinFirmware#16790 as not ready for primetime.

* Add a caution to drivers.h

* Update MKS BASE and v1.6 pins (MarlinFirmware#16806)

* Add g-code quoted strings, improve stream code (MarlinFirmware#16818)

* Fix out-of-order M0 after SD printing

Fixes MarlinFirmware#14774

Co-Authored-By: tol2cj <tol2cj@users.noreply.github.com>

* Fix out-of-order M0 after SD printing

Fixes MarlinFirmware#14774

Co-Authored-By: tol2cj <tol2cj@users.noreply.github.com>

* Enable hotend / bed PID separately in ExtUI (MarlinFirmware#16827)

* Fix MKS Robin Nano platformio.ini entry (MarlinFirmware#16826)

* Unify step pulse timing of ISR / babystep (MarlinFirmware#16813)

* [cron] Bump distribution date (2020-02-11)

* Update SAMD51 EEPROM repo link (MarlinFirmware#16832)

* Undo driver type auto-assignment for now

Good general concept but needs more time to develop and group with a stepper suite.

* No Z sensorless req'd if homing with probe

Fixes MarlinFirmware#16674

* Recommend Z Safe Homing

Co-Authored-By: Vertabreaker <opyrus@hotmail.com>

* Use prior babystep delay method (MarlinFirmware#16833)

* Function-style critical section macros

* Fix up tests

* Simplify old safe homing sanity check

* Prevent pin glitches on out commutation (MarlinFirmware#16835)

Better for switching from pulled input to output and also set real output (with no input enabled).

* [cron] Bump distribution date (2020-02-12)

* Define MarlinSerial instances for DGUS (MarlinFirmware#16841)

* No limit needed on this raise

Remove an extraneous limit from MarlinFirmware#16811.

* [cron] Bump distribution date (2020-02-13)

* [cron] Bump distribution date (2020-02-14)

* Fix G-code line parsing (MarlinFirmware#16840)

* Ping the job timer in M140 (MarlinFirmware#16849)

* Remove unused queue.stopped_N (MarlinFirmware#16850)

* Don't assert safe homing for delta/scara

* Fix ESP32 warning, specify supported version

* Add ESPAsyncTCP to lib_ignore (MarlinFirmware#16844)

* Add RAMPS 1.4.4 to AGCM4 (MarlinFirmware#16606)

* Clean up host actions code (MarlinFirmware#16856)

* Optimize "Dismiss" string

* Clean up stepper and babystep (MarlinFirmware#16857)

* Fysetc S6 pins / LCD updates (MarlinFirmware#16830)

* [cron] Bump distribution date (2020-02-15)

* Fix mftest -b and -u. Add --help.

* Fix a BORG compile warning

* Fix byte-to-percent display

Fixes MarlinFirmware#16866

* Conceal float rounding errors on display

Fix MarlinFirmware#16866

* [cron] Bump distribution date (2020-02-16)

* Double ADC read frequency (MarlinFirmware#16864)

* EXPERIMENTAL integrated BABYSTEPPING (MarlinFirmware#16829)

* Show '*' for zero 'stst' flag

* Require TMCStepper 0.6.2

* Defer updated ADC

* Move SAMD51 Temperature timer to RTC (MarlinFirmware#16868)

* Fix unknown command on empty lines (MarlinFirmware#16867)

* Fix mftest -b -u line match

* Update French language (MarlinFirmware#16877)

* Put ESP32 I2S stepper task and Marlin on the same core (MarlinFirmware#16874)

* Fix babystep include, typos in stepper.cpp

Fix MarlinFirmware#16881

* [cron] Bump distribution date (2020-02-17)

* [cron] Bump distribution date (2020-02-18)

* [cron] Bump distribution date (2020-02-19)

* [cron] Bump distribution date (2020-02-20)

* Serial redirect for Move Command when stopping (MarlinFirmware#16906)

* [cron] Bump distribution date (2020-02-21)

* Single envs for specific boards

* Inline manage_inactivity, tweak autoreport_paused

* Function for CONFIG_ECHO_HEADING

* Show end prompt with Print Event LEDs

* Add a note on EEPROM todo

* Tweak process_line_done for speed

* More EEPROM cleanup

* Followup to autoreport patch (MarlinFirmware#16914)

See a1f026f

* Disable spreadcycle in tmc_enable_stallguard<2209> (MarlinFirmware#16890)

* Fix EEPROM errors with EXTRUDERS == 0 (MarlinFirmware#16898)

* Add PICA shields support (MarlinFirmware#16891)

* Tweak pins spacing, comments

* Version 2.0.4 Release

* [cron] Bump distribution date (2020-02-22)

* Use moves_free in ok_to_send

* Hotfix for Babystepping

* CoreXY Babystepping hotfix

* Use moves_free in ok_to_send

* [cron] Bump distribution date (2020-02-22)

* Hotfix for Babystepping

* [ESP32] Allow user to define pins for hardware Serial1 and Serial2 (MarlinFirmware#16918)

* CoreXY Babystepping hotfix

* Version 2.0.4.1 Release

* [cron] Bump distribution date (2020-02-23)

* Finish Custom User Menu sanity-check (MarlinFirmware#16917)

* Followup to babystep hotfix

* Fix M0/M1 broken wait loop (MarlinFirmware#16921)

* Define ANET_FULL_GRAPHICS_LCD pins for SKR 1.4 (MarlinFirmware#16928)

* Version 2.0.4.2 Release

* Suppress "packed member" warning

* Suppress "packed member" warning

* Commit last SD line before fileHasFinished

* Allow LCD_PIXEL_WIDTH/HEIGHT override

* Allow USE_GCODE_SUBCODES for debugging

* Sync Italian language (MarlinFirmware#16935)

* Reduce default TMC baudrate to 57600 with Software Serial (MarlinFirmware#16930)

* [cron] Bump distribution date (2020-02-24)

* Fix AXIS_HAS_SW_SERIAL

* Simplified E_AXIS_HAS macro

* "Init. Media" => "Attach Media"

* Fix Babystepping loop (again)

* BS_TOTAL_AXIS => BS_TOTAL_IND

* Allow Z_SAFE_HOMING_POINT outside bed (MarlinFirmware#16945)

* Restore tabs in Makefile (MarlinFirmware#16944)

* Fix card_eof error

* Version 2.0.4.3 Release

* Allow Z_SAFE_HOMING_POINT outside bed (MarlinFirmware#16945)

* Restore tabs in Makefile (MarlinFirmware#16944)

* Fix card_eof error

* [cron] Bump distribution date (2020-02-25)

* Update POWER_LOSS_PIN comment (MarlinFirmware#16957)

* Update Italian language (MarlinFirmware#16947)

* Fix LCD cutter/bed icons overlapping (MarlinFirmware#16956)

* Fix SKR 1.4 Turbo SD_DETECT_PIN (MarlinFirmware#16955)

* Fix the wait loop in M0 / M1

* [cron] Bump distribution date (2020-02-26)

* Ensure proper SD print completion (MarlinFirmware#16967)

* HAS_SDCARD_CONNECTION is more obsolete

* Fix GTR10 overlapping defines (MarlinFirmware#16976)

* Toolchange improvements (MarlinFirmware#16979)

* Language: "failsafe" => "Defaults"

* Use a STR_ prefix for non-translated strings

* Set LCD status for EEPROM errors (MarlinFirmware#16977)

* More serial strings

* Add LPC1768 Serial ports for pinsDebug (MarlinFirmware#16980)

* Correct SKR expansion port pins (MarlinFirmware#16974)

* String optimize followup

* Fix Trinamic pulse rate auto-assignment (MarlinFirmware#16966)

* Allow weird probe values in G33

* Serial strings in macros

* Sanity check for LPC serial pin conflict (MarlinFirmware#16981)

* Allow servo features in combination (MarlinFirmware#16960)

* Add TRAVEL_EXTRA_XYJERK option

See MarlinFirmware#16949

Co-Authored-By: josedpedroso <josedpedroso@users.noreply.github.com>

* Quick-homing sensorless back-off (MarlinFirmware#16872)

* Prevent park_point compile error

* More extra travel jerk changes

Co-Authored-By: josedpedroso <josedpedroso@users.noreply.github.com>

* Fix unified status bed temp display

* Allow print recovery after parking

* Case-insensitive g-code option (MarlinFirmware#16932)

* Define DIAG pins for MKS SGen-L

* Handle print completed LED event in M0

* [cron] Bump distribution date (2020-02-27)

* Fix planner.cpp compile (MarlinFirmware#16996)

* Update Slovak language (MarlinFirmware#17002)

* Version 2.0.4.4 Release

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
Co-authored-by: Acenotass <44540957+Acenotass@users.noreply.github.com>
Co-authored-by: rebel1 <453277+rebel1@users.noreply.github.com>
Co-authored-by: Jason Smith <jason.inet@gmail.com>
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Co-authored-by: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com>
Co-authored-by: ellensp <ellensp@hotmail.com>
Co-authored-by: felixstorm <felix.storm@glueckkanja.com>
Co-authored-by: Bob Kuhn <bob.kuhn@att.net>
Co-authored-by: thisiskeithb <13375512+thisiskeithb@users.noreply.github.com>
Co-authored-by: Tanguy Pruvot <tpruvot@users.noreply.github.com>
Co-authored-by: Robby Candra <robbycandra.mail@gmail.com>
Co-authored-by: Robert Stein <robert.stein@requisis.com>
Co-authored-by: Fabio Santos <fabiosan@live.com>
Co-authored-by: Giuliano Zaro <3684609+GMagician@users.noreply.github.com>
Co-authored-by: Daniel Mazurkiewicz <daniel@latanie.info>
Co-authored-by: tol2cj <tol2cj@users.noreply.github.com>
Co-authored-by: proferabg <proferabg@users.noreply.github.com>
Co-authored-by: darksiah <siatam@gmail.com>
Co-authored-by: Vertabreaker <opyrus@hotmail.com>
Co-authored-by: Gaston Dombiak <gdombiak@gmail.com>
Co-authored-by: vivian-ng <vivian@maplerain.com>
Co-authored-by: George Fu <nailao_5918@163.com>
Co-authored-by: Karl Andersson <karl@iaccess.se>
Co-authored-by: Jamie <vector76@users.noreply.github.com>
Co-authored-by: ZMiguel Alves <zmiguel@users.noreply.github.com>
Co-authored-by: Marcio T <mlt4356-github@yahoo.com>
Co-authored-by: josedpedroso <josedpedroso@users.noreply.github.com>
Co-authored-by: Makoto Schoppert <makotosan@gmail.com>
Co-authored-by: Roman Moravčík <roman.moravcik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants