Author Topic: Can you do STM32 TFT on internal SRAM for the framebuffer?  (Read 4409 times)

0 Members and 1 Guest are viewing this topic.

Offline alank2Topic starter

  • Super Contributor
  • ***
  • Posts: 2185
Can you do STM32 TFT on internal SRAM for the framebuffer?
« on: June 22, 2017, 01:03:32 pm »
I noticed that some STM32's have a TFT controller, but their STM32F746G-DISCO comes with sdram presumably for the frame buffer.  With a smaller TFT like 480x272, it is feasable/possible to avoid external memory and run the frame buffer in sram?  What is the lowest bpp you can do?  Do you need two framebuffers, one for what is displayed and one being modified?
 

Offline bktemp

  • Super Contributor
  • ***
  • Posts: 1616
  • Country: de
Re: Can you do STM32 TFT on internal SRAM for the framebuffer?
« Reply #1 on: June 22, 2017, 01:54:25 pm »
The lowest number of colours is 8bit using either grayscale or a LUT for 256 out of 16.7M colours. For 480x272 that gives a memory requirement of 127.5kBytes. That should fit in internal memory.
You don't need doublebuffering if you don't care about image changes being visible on the display.
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Can you do STM32 TFT on internal SRAM for the framebuffer?
« Reply #2 on: June 22, 2017, 02:09:56 pm »
I noticed that some STM32's have a TFT controller, but their STM32F746G-DISCO comes with sdram presumably for the frame buffer.
The SDRAM is general purpose RAM and works for any purpose. (You can use it for uCLinux if you want to...) Extra RAM does help with the framebuffer though.
With a smaller TFT like 480x272, it is feasable/possible to avoid external memory and run the frame buffer in sram?  What is the lowest bpp you can do?
You got at most 20 bits per pixel. So for 16bpp RGB565 or 8bpp indexed it is probably okay. But if you want to step it up to 24bpp RGB888 even 32bpp ARGB8888 format you will need the extra RAM.
Do you need two framebuffers, one for what is displayed and one being modified?
Two framebuffers does make animations a lot smoother - construct the frame while it is not shown, and always show the finished image without touching it again.
 

Offline alank2Topic starter

  • Super Contributor
  • ***
  • Posts: 2185
Re: Can you do STM32 TFT on internal SRAM for the framebuffer?
« Reply #3 on: June 22, 2017, 02:17:02 pm »
Thanks--do you guys think the STM32F746G-DISCO is a good thing to get started with STM32/TFT or is there something better?
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Can you do STM32 TFT on internal SRAM for the framebuffer?
« Reply #4 on: June 22, 2017, 02:25:09 pm »
Thanks--do you guys think the STM32F746G-DISCO is a good thing to get started with STM32/TFT or is there something better?
I think it is one of the best out there - I am still playing with STM32F407ZG with 1MB external SRAM and 16MB external Flash for this.

Speaking of, if you have a lot of static images you can just get the graphics controller to load the image directly from built-in Flash or the external QSPI Flash.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Can you do STM32 TFT on internal SRAM for the framebuffer?
« Reply #5 on: June 22, 2017, 02:34:12 pm »
It's possible to use the internal DMA2d "Chrom-Art Acceletor" with a Colour Look Up Table (CLUT) down to 4 bits per pixel, giving 480x272x4/8=65280 bytes for 16 selectable colours (in L4 mode) or 2 colors with Alpha (in A4 mode).

This, given the 320kB (+change) on a 746NG gives some elbow room also for double buffering, but using the internal RAM controller is no problem, if you get the Disco.

The 746 Disco is definitely an interesting board (I've got two  ::), but one was complimentary), though it might pack more stuff than what you are looking for: the external connectivity is a bit limited by the number of IOs used for onboard peripherals.
Check the revision of the processor and the relevant errata. I got mine with one of the early masks (and longish errata).

The display mode is fixed: only RGB interface can used, no SPI or bus mode, in case you were interested.

You can also follow an online MOOC on the ST site that uses it. IIRC, the goal of the exercises its to design a (toy) scope.

A cheaper alternative could be the 429 Disco, with its much smaller display (can be set to all the supported modes).
Nandemo wa shiranai wa yo, shitteru koto dake.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf