Forum Discussion

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

Write to VIP frame buffer

Hi

I tried to ask in the NIOS forum no responds so I will try here

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

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 start 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)

#define IMAGE_MEMORY 0x08000000

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?

I also do stop the scaler before I try to write to the buffer

the_scaler.stop(true);

Please advise how to put a image to the frame buffer

Thank you

Wiljan

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    > Please advise how to put a image to the frame buffer

    Hello,

    the short answer is that it is hard to put an image into the frame buffer and that you probably should not be doing it. The frame buffer is useful to solve throughput and rate conversion issues but you cannot use it just to read things from memory. The VIP User guide describes how the frame buffer manages the buffers in memory and how these buffers are exchanged between a writer module and a reader module. This algorithm implies that the frame buffer can only read back the video frames it received from its Avalon-Streaming input.

    You might want to check out the scatter-gather DMA IP as this might be more appropriate to meet your needs.

    vgs