pimoroni / pimoroni-pico

Libraries and examples to support Pimoroni Pico add-ons in C++ and MicroPython.
https://shop.pimoroni.com/collections/pico
MIT License
1.29k stars 492 forks source link

Pico2 slows down display pack #1005

Open peardox opened 6 hours ago

peardox commented 6 hours ago

Yeah, I couldn't believe it either...

Soldered up 2x Pico 2 and 1x Pimoroni Pico Plus 2 to try them out on diplsy packs

On my Pico Ws the display_pack_2_demo runs at 30fps (I added frame timing)

On all Pico 2 devices the FPS drops tro 24fps - tried all three devices I have to hand

Tested on a display pack 2.8 - I have the others as well but doubt there'll be much change (apart from the smallest as it has a smaller screen), the 2 + 2.8 are just a bigger LCD, exact same pixel counts

Gadgetoid commented 6 hours ago

I am wholly unsurprised! Though I don't have a good inkling for why it might be the case.

One possible candidate might be the 125MHz clock that MicroPython has been setting for the RP2 port until recently. Though I would expect this to make the Pico 2 not faster rather than slower (regardless of the improvements to processing time of the image, it would limit the data throughput which might be enough to slow things down.)

I would have implicated PSRAM, but since the Pico 2 doesn't have any that wouldn't make much sense...

Benchmarks clearly show the Pico 2 as being faster, though, so my best guess is that we're not correctly configuring the clock.

Do you have a minimal repro that shows the framerate difference without much extra cruft?

peardox commented 6 hours ago

Ahh - just spotted #985

@Gadgetoid I'll stick my code on Github in a little while and add a note here

peardox commented 6 hours ago

Here you go - https://github.com/peardox/display_pack_28

The repo is all-in-one. As long as you have a 2.8" pack and a pico 2 it'll run without changes

Oh and my Pico 2's have never been assulted by MicroPython :)

peardox commented 5 hours ago

And adding the patch from #985 makes the framerate zoom up to 45fps

Tada (might need a different value for stability) - this fix has not been pushed - just edit drivers/st7789.hpp as suggested to try it out

Gadgetoid commented 5 hours ago

I'm happy if you want to make a pull-request of it and claim the glory :laughing:

I had assumed you were using MicroPython, so I was waaaaaay off.

peardox commented 5 hours ago

I was already thinking of doing a PR with the modifications just for the display_pack_28 definitions but also adding the FPS demo will be nicer

I wanna check out the SPI rate as (150/133) * 62,500,000 |= 75,000,000 (actual value is a funny number so wanna experiment first)