Shop OBEX P1 Docs P2 Docs Learn Events
exMem + WVGA in 16bpp — Parallax Forums

exMem + WVGA in 16bpp

Been learning how to use the exMem (external memory) driver with the raycasting code:
https://forums.parallax.com/discussion/169389/90s-style-3d-now-at-16bpp-using-psram#latest

Now, trying it with something perhaps more useful, an exMem based video buffer.
Thinking 16bpp in WVGA is a good place to be.

This allows use of a single PSRAM chip with plenty of extra bandwidth (probably).
Could be regular VGA, HDMI, or IPS LCD display.

Here testing with a 4.3" WVGA IPS display in 16bpp mode, as described here:
https://forums.parallax.com/discussion/176069/4-3-and-5-0-ips-tft-16bpp-adapters-for-platform-eval-edge#latest

This code is showing a WVGA bird image from exMem (specifically the 24MB PSRAM module).
Pretty sure just using the first of three PSRAM chips.

Just got it working a minute ago. Seems perfectly stable and there's no flicker at 300 MHz.
Think needs about 250 MHz to prevent flicker completely. Will need more like 300 MHz for HDMI...

Comments

  • RaymanRayman Posts: 15,799
    edited 2025-10-18 17:00

    Thinking there's enough bandwidth and HUB memory to do an HMI type application where a new frame is put together in HUB RAM and then sent to exMem for display. Should be able to make it fairly responsive.

    Not enough HUB for full image though, so maybe have to do half at a time.
    Or, use exMem for both image buffers.
    That might be a bit slow, have to check.

    Using the 16-bit wide PSRAM would surely be enough.

  • RaymanRayman Posts: 15,799

    There is also this PSRAM stuff that Chip did:
    https://forums.parallax.com/discussion/175725/anti-aliased-24-bits-per-pixel-hdmi/p3

    Makes anti-aliased lines and now circles.
    But, kind of thinking that HMI just needs rectangles for things like buttons.
    Still, lines and circles could be good for sliders...

  • RaymanRayman Posts: 15,799

    Cleaned up the code a bit and turned it into a slide show.

    Every 5 seconds it copies an entire image from one place in PSRAM, to the display buffer in PSRAM.
    This appears instantaneous even with no syncing with display cog.
    That's a good sign that bandwidth is plenty, even with 4-bit PSRAM.

  • roglohrogloh Posts: 6,097
    edited 2025-10-19 12:00

    Using my graphics requests within my memory driver you can easily update window data fast. As well as HUB to ext-mem and ext-mem to HUB I also have a ext-mem to ext-mem graphics copy request so you can blt window portions about in single requests in the background while you do other things. It does slow down more for very hires and deeper colour configs but a paint API that refreshes only rects that are needed would easily allow windowing/GUI applications on the P2. The key is to keep your drawn window parts in external memory and only repaint what you need (i.e. not the entire screen every time). Also dragging window outlines instead of window contents can help if you are moving windows about with a mouse, prior to the final update. Rendering optimized for line at a time transfers into graphics memory is also more efficient. e.g. text.

  • blittledblittled Posts: 693
    edited 2025-10-23 03:19

    Great work Rayman. I just got one of your 24mb PSRAMS and have been itching to use it. I also just got a 1024X600 7" HDMI display. Could your code work with this display and is the 24mb large enough and fast enough to use with this resolution? Or would it need to be 8bpp?

  • RaymanRayman Posts: 15,799

    @blittled might work at 16 bpp but don’t know…

    Pretty sure can do at least 8bpp

  • pik33pik33 Posts: 2,416

    1024x600 HDMI at 24 bpp should be possible with 3 PSRAMs. I have a 1024x600 driver at 32 bpp for P2-EC32 on HDMI and 1920x1080 8bpp on VGA.

    However, P2 and PSRAM limits the maximum stable clock to about 340 MHz. That limits the HDMI pixel clock to 34 MHz, and then the refresh rate to about 50 Hz at 1024x600
    (and it still needs nonstandard timings stretched to the limits to get 1024x600x50 at 34 MHz pixel clock).

    VGA doesn't have this limit, but the PSRAM bandwidth doesn't allow any more than 8 bpp at full HD with 4 PSRAM chips

    If you have one of these Waveshare 1024x600 touch displays, you can also get touch points via USB. We experimented with this and got some results (and then abandoned further experiments)

  • Thanks for the info pik33. I don't have a Waveshare I have an Ipistbit 7" 1024 x 600 which is similar but doesn't have the VGA mode. I was going to analyze your driver to understand how to change the timings and how to apply the 4 bit 24MB psram.

Sign In or Register to comment.