Shop OBEX P1 Docs P2 Docs Learn Events
Frame-buffer dilemma — Parallax Forums

Frame-buffer dilemma

John A. ZoidbergJohn A. Zoidberg Posts: 514
edited 2012-06-29 05:42 in General Discussion
Hello there,

Basically, I've gotten myself some SRAM chips, stacked them to form like 128KBytes of them. These can store two 256x240 resolution frames, in 8-bits for the sake of double-buffering. The first frame is being sent to another microcontroller to the VGA output, while the other frame is being 'painted', and these roles of frames are reversed continuously.

The thing is, while the SRAM module is being used for 'painting' the screen, how am I supposed to write it inside together? It could be a collision if that happens.

I'm thinking of using the dual-ports but many of them are small and expensive.

Any ideas of graphics memory? :)

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-06-27 08:03
    You either need multi-port memories or you need to timeshare the memories. Typically, the retrace interval is used for writing to the frame buffer. You have a little time when the frame buffer is not in use at the end of a line. That's when the horizontal sync pulse is issued. There's a longer retrace interval at the end of a frame when the longer vertical sync pulse is issued. During the retrace intervals, you can read or write to the frame buffer without affecting the display. For graphics, you do the same thing.
  • msrobotsmsrobots Posts: 3,709
    edited 2012-06-27 15:19
    How about 2 different RAM blocks with different Pins "switching" them out via software-handover?
    Or using those latches, used on C3 for multiuse SPI, switching "read-ram" and "write-ram" between two sets of pins?

    Enjoy!

    Mike
  • KyeKye Posts: 2,200
    edited 2012-06-28 16:30
    You display from one then write to the other. Then you swap. Do this every frame.
  • katefdhkatefdh Posts: 7
    edited 2012-06-29 04:41
    New knowledge shared by you thanks for such a useful information ...!!
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2012-06-29 05:42
    Kye wrote: »
    You display from one then write to the other. Then you swap. Do this every frame.

    I did that already on a processor (PIC32) using only 1-bit graphics, but to use an external parallel SRAM for that could be difficult.

    I'm thinking of getting the dual-ported RAMS but they are way too expensive. Maybe I have to "time-share" it or something else.
Sign In or Register to comment.