TMCStepper icon indicating copy to clipboard operation
TMCStepper copied to clipboard

Use different hardware spi

Open mr-miky opened this issue 5 years ago • 2 comments

On the board that I designed and uses stm32F4 there are 3 spi hardware. The TMC2130 that I use are connected to a dedicated spi hardware. The TMCStepper library relies on the software spi or the Arduino SPI. What I ask is if it is possible to implement a method to pass the pointer to a SPIClass other than the standard Arduino one.

I currently use a SPIClass * TMC_HW_SPI pointer declared extern and initialized in MarlinCore.cpp. The problem is that I have to patch the TMCStepper library every time a new version is released.

If I want to use the Arduino SPI:

TMC_HW_SPI = & SPI;

if not :

TMC_HW_SPI = new SPIClass (SPI1, TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK);

If there was a method to pass the pointer it would be more portable without changing the library code.

mr-miky avatar Aug 01 '20 13:08 mr-miky

See the upcoming Release_v1 branch. It's still very much alpha stage at this point though.


From: mr-miky [email protected] Sent: Saturday, August 1, 2020 4:09:00 PM To: teemuatlut/TMCStepper [email protected] Cc: Subscribed [email protected] Subject: [teemuatlut/TMCStepper] Use different hardware spi (#142)

On the board that I designed and uses stm32F4 there are 3 spi hardware. The TMC2130 that I use are connected to a dedicated spi hardware. The TMCStepper library relies on the software spi or the Arduino SPI. What I ask is if it is possible to implement a method to pass the pointer to a SPIClass other than the standard Arduino one.

I currently use a SPIClass * TMC_HW_SPI pointer declared extern and initialized in MarlinCore.cpp. The problem is that I have to patch the TMCStepper library every time a new version is released.

If I want to use the Arduino SPI:

TMC_HW_SPI = & SPI;

if not :

TMC_HW_SPI = new SPIClass (SPI1, TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK);

If there was a method to pass the pointer it would be more portable without changing the library code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/teemuatlut/TMCStepper/issues/142, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB3HF7RJVRC2MVKIRXCBVRDR6QHWZANCNFSM4PRXM5QQ.

teemuatlut avatar Aug 01 '20 14:08 teemuatlut

Hello, has this been implemented? I am using a teensy 4.1 and would like to utilise SPI1 instead of SPI with a TMC5160. Just wondering if this is possible...

rohan-patel367 avatar Mar 27 '24 06:03 rohan-patel367