You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Bodmer
Great library, thx for your hard work.
I'm using the arduino compiler and need to run more than 1 device off the spi1 bus on an stm32f401.. processor. The issue is that the clock speeds differ. Running at the slow clock speed is too slow .. .
Edit :
I seem to have run into a few issues with this. It seems that changing the clock speed on the user setup file has no effect on the actual speed. I have a section of code which displays a screen of text options which takes 164mS to display using millis(). It takes this time regardless of the #define SPI_FREQUENCY setting in user setup.
Using this in conjunction with an external eeprom library (EEPROM_SPI_WE), the screen write speed drops from 164 to 425mS.
I hope to be able to measure the actual spiclock speed soon, to try to get to the bottom of this. I temporarily renamed the setup library to ensure it was being used and the compile failed, so it was definitely in the loop.
Is it possible to reset the correct speed for the tft device? or end (destroy) the tft device and re create it?
Many Thanks
Best Regards
picclock
The fix 👍
It seems the spi clock divider is not reset after different bus access. For STM32F4 family clock is set by a divider with a master clock of 84MHz in my case (25MHz xtal). so 42MHz is the best I can hope for.
SPI.setClockDivider(SPI_CLOCK_DIV2); seems to do the trick, though the fix is deprecated in Arduino.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Bodmer
Great library, thx for your hard work.
I'm using the arduino compiler and need to run more than 1 device off the spi1 bus on an stm32f401.. processor. The issue is that the clock speeds differ. Running at the slow clock speed is too slow .. .
Edit :
I seem to have run into a few issues with this. It seems that changing the clock speed on the user setup file has no effect on the actual speed. I have a section of code which displays a screen of text options which takes 164mS to display using millis(). It takes this time regardless of the #define SPI_FREQUENCY setting in user setup.
Using this in conjunction with an external eeprom library (EEPROM_SPI_WE), the screen write speed drops from 164 to 425mS.
I hope to be able to measure the actual spiclock speed soon, to try to get to the bottom of this. I temporarily renamed the setup library to ensure it was being used and the compile failed, so it was definitely in the loop.
Is it possible to reset the correct speed for the tft device? or end (destroy) the tft device and re create it?
Many Thanks
Best Regards
picclock
The fix 👍
It seems the spi clock divider is not reset after different bus access. For STM32F4 family clock is set by a divider with a master clock of 84MHz in my case (25MHz xtal). so 42MHz is the best I can hope for.
SPI.setClockDivider(SPI_CLOCK_DIV2); seems to do the trick, though the fix is deprecated in Arduino.
Beta Was this translation helpful? Give feedback.
All reactions