Closed GadgetAngel closed 3 years ago
I answered my own question, see the following link: https://github.com/bigtreetech/BIGTREETECH-SKR-PRO-V1.1/issues/179#issue-741317998
@GadgetAngel can you tell me what your jumper settings are for your TMC5160 drivers?
@phongshader you set them for SPI mode. Look at this manual it might help. https://github.com/GadgetAngel/GTR-V1.0-Stepper-Driver-Jumper-Configuration-Manual/blob/master/CURRENT-Manual/GTR%20V1.0%20Stepper%20Driver%20Jumper%20Configuration%20Version%204.5_reducedFileSize.pdf
I have a GTR V1.0 board with BIQU TMC5160 stepper motor drivers. My printer is Creality Ender-3 Pro. The motherboard is the GTR V1.0 with TMC5160 on X, Y, Z and E0, I have a V6 hot end and want to attach a PT100 temperature sensor using the Adafruit MAX31865 amplifier board. All other equipment is what came with the Creality Ender-3 Pro. I want to use the Adafruit MAX31865 board and use hardware SPI Protocol in Marlin to communicate between the MAX31865 board and the GTR V1.0 board. I will not be using the K-Type Thermocouple port.
I downloaded the latest bugfix version of Marlin and ONLY made the following changes from the default Marlin for "Creality\Ender-3 Pro" printer (i.e., I copied the default configuration from Creality\Ender-3 Pro\ folder to the Marlin folder). Here are the changes I made:
Changes made to configuration.h:
Changes made to configuration_adv.h:
Changes to pins_BTT_GTR_V1_0.h file to get the Adafruit MAX31865 board to talk to Marlin via hardware SPI protocol:
Changes to platformio.ini file: so that only Adafruit MAX31865 library version 1.1.0 is used:
--------------------------Configuration changes ends here---------------------------------------
It all compiles correctly with no warnings or errors.:
Default hardware SPI bus in variant.h is SPI2 or SPI bus number 2
BUT in pins_BTT_GTR_V1_0.h the variant.h SPI pins get overridden and get set to SPI1 or SPI bus number 1. This is due to the following settings in pins_BTT_GTR_V1_0.h:
In variant.h file the PA4, PA5, PA6 and PA7 point to SPI1 or SPI Bus number 1:
I want to wire in a Adafruit MAX31865 board and use hardware SPI not software SPI to communicate with the Adafruit MAX31865 board (Just because I want to do it this way).
I understand that the Adafruit MAX31865 library does not allow the user to select the SPI bus so it will default to the hardware SPI bus. There is only one default hardware SPI bus for the board.
My question is (with the above set up in firmware) which SPI bus (bus number 1 or bus number 2) is the default hardware SPI bus?
Does the SDCARD_CONNECTION to ONBOARD changes to SCK_PIN, MISO_PIN an MOSI_PIN affect Marlin globally?
The Variant.h file usually indicates the default hardware SPI bus and on this board it should be SPI 2 but then the pins_BTT_GTR_V1_0.h changes those SPI pins to SPI 1. So does it follow that the default SPI hardware bus is now SPI bus number 1?
I need to know which bus (bus 1 or bus 2) so I know where to splice into the SPI lines. If the default hardware SPI bus is bus number 2, I would place a third connector on the flat ribbon cable of EXP2. If the default hardware SPI bus number is bus number 1 then I will use the BTT TF Cloud V1.0 device and tap into the ESP-12S wireless chip's SPI lines to access the ONBOARD SD card's SPI lines. So again I ask which bus is the default hardware SPI bus for this situation (bus number 1 or bus number 2)?