Intel® FPGA University Program
University Program Material, Education Boards, and Laboratory Exercises
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
1082 Discussions

Help using DE2-115 with 640x480 pixel buffer with back buffer?

Altera_Forum
Honored Contributor II
864 Views

Hi I'm developing an audio-visualization system for my undergraduate project. I'm working the media computer example and have made some modifications to the hardware to make the SRAM frame buffer 640x480 as opposed to the default 320x240 and bypassing the scaler. The board has 2MB of SRAM which should be plenty to implement both a front and back buffer however I'm running into issues when using the pixel buffer driver in NIOS II EDS.  

 

My goal: 

Write a test C program that fills the front buffer with one color (green) so that the whole screen is green. Fill the back buffer with another color (blue) then call swap_buffers() and watch the screen change from green to blue. So far I have not been able to do this. 

 

What I've tried: 

-Modifying the pixel_buffer_dev struct and changing both front and back buffer address to be sufficiently far enough away to not overlap. ex: front buffer starts at 0x08000000 and back buffer starts at 0x080F0000 (even tried 0x08100000). SRAM address range: from 0x08000000 to 0x081FFFFF 

-Debugging the memory contents in my test program. I've noticed that writing to front buffer actually writes DOUBLE the intended address range creating a duplicate but identical buffer. 640*480 locations = 307200 yet I found calling draw_box() filled twice as many locations with the color green. 

-Sometimes making the back and front buffer address too far apart causes only one to be displayed at all and swap_buffers() does nothing. If I make the addresses too close, then the buffers overlap on the screen.  

-Bypassing the device driver and writing to the memory location directly using a volatile pointer and nested for loops. Same problem. 

 

Any help would be greatly appreciated.
0 Kudos
0 Replies
Reply