Weird SPI Clock Signal on Teensey 4.1, Pin 13

Yeah, I used the pins that were convienant for the board layout when I switch to software spi.

I will compare your library, and go back to trying hardware spi. I see you do end and begin transaction where one of the timing errors was. Nice!

Some stuff with ramp_stat that I will have to learn about.

Thank you for your reply.
 
Search for JEM. I tried to add that comment to the locations I changed.
Another change I made was in

TMC2130Stepper.cpp

Around line 35


{
// JEM
// SW_SPIClass *SW_SPI_Obj = new SW_SPIClass(pinMOSI, pinMISO, pinSCK);

// Serial.println(F("TMC2130Stepper::TMC2130Stepper -- TMC_SW_SPI = Not NULL, Using SPI."));
// if (SW_SPI_Obj == NULL)
// Serial.println("SW_SPI_Obj == NULL JEM.");
// TMC_SW_SPI = SW_SPI_Obj;
TMC_SW_SPI = NULL;
defaults();


If I remember, the variable SW_SPI_Obj was previously being set. I chose to leave it at null. When this was set, the code went to locations that worked on an arduino but would not on a teensey. I think the code made use of hardware features on the arduino which did not work on the teensey. Those would be in the SW_SPI_Obj class that now is bypassed to other logic that works correctly on the teensey. You can look at that to see.

When I last used this with my new board, all worked fine. I felt it was reliable with my new board and code fix.

I then switched to making sense of the 5160 advanced features like stall guard and controlling the motor in ways to not lose steps and get to a position. I was always interested in the 5160 features of telling it to move a motor to a specific posiiton and reading out its progress. My motors do not have encoders. If they did, the 5160 has some great features to make that even more reliable than the blind positioning operations I relied on.

Suffice to say, I do like the Teensey 4.1 and Bigtreetech 5160 chip combination.
 
I tried your code and have the same issues. In that the motor stalls at certain medium speeds and doesn't seem to regulate current and overheats. The thing is when I use software spi mode with the correct pins, it moves smooth at all speeds and and doesn't overheat. If I switch pins or use hardware spi it seems like it communicates fine but I get the stall and heat issue. This made me think it doesn't actually set irun, ihold, or scalers correctly, so I thought it was a communication problem.

Thank you very much for your help. I think I got to just use those particular pins in software mode, or try to figure this all out from the beginning.
 
Back
Top