I don’t think you’re answering the (spirit of the) question.
Could you redo the top image (DUMP_TMC) without the LCD attached and with it attached so the impact of the LCD can be observed?
I don’t think you’re answering the (spirit of the) question.
Could you redo the top image (DUMP_TMC) without the LCD attached and with it attached so the impact of the LCD can be observed?
@mykepredko i previously posted the following. TMC, no display. SPI Clock is 4Mhz.
I’m sure you can appreciate that this thread is really hard to follow.
Could you make up a table showing the different test cases and whether or not something works.
Something like:
This is just an example and guessed at what the test conditions are as well as just threw in something for the TMC5160 response but I think this would make the thread easier to follow and maybe get some clues as to what’s happening.
Configured Hardware | spi_speed setup? | Measured SPI CLK Speed | Operational Hardware |
---|---|---|---|
TMC2130 | No | 4Mhz | TMC2130 |
u1701 MKS Mini Display | No | 12Mhz | u1701 MKS Mini Display |
TMC2130 u1701 MKS Mini Display |
No | 12Mhz | u1701 MKS Mini Display |
TMC2130 u1701 MKS Mini Display |
Yes @ [display] spi_speed: 4000000 |
4Mhz | TMC2130 u1701 MKS Mini Display |
TMC2130 u1701 MKS Mini Display |
Yes @ [display] spi_speed: 8000000 |
8Mhz | u1701 MKS Mini Display |
sh1106 Display | No | n/a | None |
TMC2130 sh1106 Display |
No | n/a | None |
TMC2130 sh1106 Display |
Yes @ [display] spi_speed: 4000000 |
4Mhz | TMC2130 sh1106 Display |
I might have tried the sh1106 display at 10Mhz as I found that spi_speed in another project. Since the TMC drivers do not function greater than 4Mhz, it doesn’t make a differnece.
I have tried the TMC drivers with a spi_speed at 5Mhz, 8Mhz, and 12Mhz with no display and they do not function.
Now I have not tested setting the TMC drivers to 4Mhz and display to 12Mhz yet.
Setting the display to spi_speed: 12000000
and the TMC drivers to spi_speed: 4000000
the Display will function, but the TMC Drivers do not.
Sorry, I don’t understand.
From the table, it looks like when you have “Yes @ [display]/spi_speed: 4000000” you have working TMC5160s and a working display. Correct?
So what is the issue now?
That is correct.
Kevin wanted more info to look into the SPI code.
He stated:
Sounds like the SPI CLK should shift to different speeds based on what chip it’s communicating with, but that’s not how it’s currently functioning.
Searching for different devices on SPI bus only produced one result where the tech stated that the SPI CLK speed needs to the the highest speed of the slowest device.
I got a chance to look at the atsamd SPI code. It is definitely trying to change the SPI speed on each device change. So, I’m not sure why it is not working.
If you are still interested in tracking this down, you could try making the following change to src/atsamd/spi.c:
--- a/src/atsamd/spi.c
+++ b/src/atsamd/spi.c
@@ -45,7 +45,7 @@ spi_prepare(struct spi_config config)
SercomSpi *ss = (SercomSpi *)config.ss;
if (ctrla == ss->CTRLA.reg && baud == ss->BAUD.reg)
return;
- ss->CTRLA.reg = ctrla & ~SERCOM_SPI_CTRLA_ENABLE;
+ ss->CTRLA.reg = 0;
ss->CTRLA.reg = ctrla & ~SERCOM_SPI_CTRLA_ENABLE;
ss->BAUD.reg = baud;
ss->CTRLA.reg = ctrla;
If that doesn’t work, you could try this change instead:
--- a/src/atsamd/spi.c
+++ b/src/atsamd/spi.c
@@ -45,7 +45,9 @@ spi_prepare(struct spi_config config)
SercomSpi *ss = (SercomSpi *)config.ss;
if (ctrla == ss->CTRLA.reg && baud == ss->BAUD.reg)
return;
- ss->CTRLA.reg = ctrla & ~SERCOM_SPI_CTRLA_ENABLE;
+ ss->CTRLA.reg = 0;
+ while (ss->SYNCBUSY.reg & SERCOM_SPI_SYNCBUSY_ENABLE)
+ ;
ss->CTRLA.reg = ctrla & ~SERCOM_SPI_CTRLA_ENABLE;
ss->BAUD.reg = baud;
ss->CTRLA.reg = ctrla;
-Kevin
I just installed the board on my normal printer, however I can still give this a go and report back shortly.
Thanks!
Hello
I have found the source of my printer problem to be probably the location of the screen cable.