Filled Triangle

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
samneggs
Posts: 20
Joined: Tue Jun 15, 2021 12:57 am

Filled Triangle

Post by samneggs » Thu Nov 18, 2021 5:18 am

My contribution to the fledgling Pico MicroPython demo scene.

https://youtu.be/8gQgXbVStIs

samneggs
Posts: 20
Joined: Tue Jun 15, 2021 12:57 am

Re: Filled Triangle

Post by samneggs » Thu Nov 18, 2021 11:29 pm

Made a few tweaks and got moving horizon effect.

https://youtu.be/tu_bi1kk3hk

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Filled Triangle

Post by pythoncoder » Fri Nov 19, 2021 9:47 am

Nice. It would be interesting to know what display hardware and driver you're using.
Peter Hinch
Index to my micropython libraries.

samneggs
Posts: 20
Joined: Tue Jun 15, 2021 12:57 am

Re: Filled Triangle

Post by samneggs » Fri Nov 19, 2021 3:53 pm

The hardware is the Waveshare Pico Eval Board.
https://www.waveshare.com/product/raspb ... -board.htm

It's 480×320 pixels using a ILI9488/XPT2046 controller but I'm only using 240x240. The software driver is essentially the Waveshare MicroPython example code. There is a 40Mhz-ish SPI write of the 115,200 bytes of the bytearray - all standard stuff. The example shows 60Mhz but the throughput doesn't change past the 40's.

The fast part is indexing through the whole bytearray every frame reading from a color array. Interestingly writing to the display (even continuously sending a blank screen) is much slower than the all the triangle and color writing stuff.

I would love more RAM so I could write to one screen and send a copy to the display at the same time. (Hmm, I'll try that with a smaller array and see how fast I can get it...) Also, with more RAM I can have a framebuffer for the whole 480x320 although I think I'd be pushing the SPI write at that point.

Sam

samneggs
Posts: 20
Joined: Tue Jun 15, 2021 12:57 am

Re: Filled Triangle

Post by samneggs » Sat Nov 20, 2021 1:39 am

Oops, I misspoke. I double checked and the screen coloring, not the SPI write does take up most of the resources. The whole demo runs at 7 FPS and if i remove the color stuff I get 25 FPS. The maximum possible FPS at 240x240 measured by timing the SPI write is 28 FPS. Regardless, it still irks me that the SPI seems to 'work' up to about 62Mhz but there is no performance improvement above 30-something Mhz.
Sam

Post Reply