RP2040 Bouncy_Circles example - fps #2095
Replies: 4 comments 3 replies
-
If the CPU clock is set higher than 125MHz then the maximum SPI clock rate is reduced to 24MHz by the board package (not TFT_eSPI,). This is done because the SPI peripheral is only specced to be clocked at 125MHz max. (this means 62.5MHz maximum output rate because there is a divide by 2 in the SPI peripheral). So to get the maximum SPI peripheral clock speed the processor must be run at 125MHz, this would then give ~45fps for the sketch. Using PIO for SPI means the maximum. SPI clock rate is always half the CPU frequency even if it is overclocked. It is possible to force the SPI peripheral to be overclocked using instructions in the sketch. I will post them if I can remember which sketch I tested them in. Load the latest master copy of TFT_eSPI to get rid of the compile error. |
Beta Was this translation helpful? Give feedback.
-
Thank's very much for your reply.
I guess it is a silly question, but how is it done? I looked aound in the Internet, but didn't find anything for the Pico. Thanks and reagards Ralf |
Beta Was this translation helpful? Give feedback.
-
Thanks again for your reply. I looked around and found how to set the system clock with earlephilhower's framework: Just using the PIO without setting the system clock to 125MHz haven't boost up as much as setting the system clock to 125MHz. There is one drawback I realized when using PIO as SPI out and/or setting the system clock to 125MHz. A connectes servo does not work anymore. I haven't gone into detail what the reason is. |
Beta Was this translation helpful? Give feedback.
-
Thanks again, it's running perfect and fast! Tried to mark it as resolved, but I can't change the label |
Beta Was this translation helpful? Give feedback.
-
I am playing around with your excellent library and have setup a Raspberry Pico with an ILI9341 Display from Waveshare.
Once connected I tried two examples from your library, the Bouncing_Circles and the RotatingCube. For the RotatingCube I am getting 80fps, for the Bouncy_Circle 17.9fps. Within the example it is written that it usually runs at 45-48fps, and I am wondering what I am missing to achieve this. As I am using PlatformIO, I have setup the platformio.ini like below. Changing the SPI frequnecy has no effect and using RP2040_PIO_SPI results in a compile error
.pio\libdeps\rpipico\TFT_eSPI\TFT_eSPI.cpp:994:10: error: 'dir_mask' was not declared in this scope
.Do you have tips for me?
Thanks and regards
Ralf
[env:rpipico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = rpipico
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0M
lib_ldf_mode = chain+
upload_protocol = mbed
lib_deps =
bodmer/TFT_eSPI
bodmer/TJpg_Decoder
build_flags =
; Define the TFT driver, pins etc here:
-DUSER_SETUP_LOADED=1
-DILI9341_DRIVER=1
;-DGC9A01_DRIVER=1
;-DTFT_HEIGHT=240
;-DTFT_WIDTH=240
-DTFT_CS=12
-DTFT_DC=13
-DTFT_RST=14
-DTFT_BL=15
-DTFT_SCLK=18
-DTFT_MOSI=19
-DLOAD_GLCD=1
-DLOAD_FONT2=1
-DLOAD_FONT4=1
-DLOAD_FONT6=1
-DLOAD_FONT7=1
-DLOAD_FONT8=1
-DLOAD_GFXFF=1
-DSMOOTH_FONT=1
;-DSPI_FREQUENCY=32000000
-DSPI_FREQUENCY=80000000
;-DRP2040_PIO_SPI
monitor_speed = 115200
Beta Was this translation helpful? Give feedback.
All reactions