Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

Avalon FrameBuffer

Hi

I'm new here, I could use a litle help

I have a Cyclone III development board and do use Quartus 9 and Nios II 9

I have added a OLED 480x272 display to the port of the Cyclone III board

I did some tweek omn the pong game from fpga4fun and had it to work with the Oled display :-)

Then I moved to the VIP

In the SOPC I have a Test Pattern Generator (720x576) => Scaler (480x272) => Frame Buffer => Color Plane Sequeenser => Clocked video out

my sopc (http://www.tech2net.dk/stuff/oled_sopc.jpg)

It works fine ... then I added a Nios II CPU and onchip_mem and Jtag and now I have mde some simple C code controlling the scaler and it works fine

My next test was to load in a image to the frame buffer ( I strat with something simple ...a simple RGB colorbars) this does NOT work

In the SOPC I can see my DDR2 ram start at 0x08000000 .... so I want to write some data to the framebuffer for 480x272

I have seen in another example they do use this for 640x480 (sure I have tried to adjust to 480x272)

IOWR(VGA_BASE, 0, (unsigned int) IMAGE_MEMORY); // set the base address of the image

IOWR(VGA_BASE, 1, 0x028001E0); // configure the VGA controller for a 640x480 image

IOWR(VGA_BASE, 2, 0x0001); // turn on the VGA controller with interrupts disabled.

What should the VGA_BASE be?

r = 0xf800; g = 0x07e0; b = 0x001f;

for(j=0;j<640*(480+1);j+=640)

for(i=0;i<640;i++)

if(i<640/4)

*((volatile short *) IMAGE_MEMORY + i + j) = r;

else if(i<640/2)

*((volatile short *) IMAGE_MEMORY + i + j) = g;

else if(i<3*640/4)

*((volatile short *) IMAGE_MEMORY + i + j) = b;

else

*((volatile short *) IMAGE_MEMORY + i + j) = 0xffff;

I need to know what are needed when try to load data to the Avalon framembuffer?

Do I understand it correct I first have to stop the old frame and the make a new then

define width x height and point on mem start and the load in some data and the start the frame?

Please advise

Thank you

Wiljan
No RepliesBe the first to reply