Intel® FPGA University Program
University Program Material, Education Boards, and Laboratory Exercises
1175 Discussions

[DE2-Help] Putting images in SRAM or FLASH, then displaying them on VGA Output

Altera_Forum
Honored Contributor II
2,703 Views

Hello everyone, 

 

I am having trouble understanding how to first of all put images into memory (a.k.a. how do I upload them from my computer) and then being able to access them using Verilog in order to display them using the vga controller. My vga controller works and I am able to draw things manually but it is hard to create complex designs this way. 

AKA. 

Image 1-4 are in memory 

 

If(state == 00)  

draw image 1 at some x & y location 

else if(state == 01) 

draw image 2 at some x & y location 

 

and so on.. 

 

If anyone could help me it would be most appreciated. 

 

Thanks, 

Pachu 

 

Edit: - Also.. I do not want to implement this using NIOS unless that is the only way.
0 Kudos
14 Replies
Altera_Forum
Honored Contributor II
1,379 Views

Hi Pachu. 

Read in this thread my last post, maybe it could help you. 

http://www.alteraforum.com/forum/showthread.php?t=3094
0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

Hi BTXSistemas, 

 

Thanks for replying, but that does not really help me, I guess what I am asking for is an explanation on how to go about even getting the images into memory and how I can access multiple images and only display them when/where I want. 

 

Thanks, 

Pachu
0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

Pachu. 

What I did ( in example mode) is to upload an image from my computer to the DE2 board using serial port, then I save it in SRAM, and then I show it in the VGA, at 320x240 in 24 bit color. I think it's only difeers from your needs, that you want more than one image.  

I can share the verilog code here, although all quartus project is a bit heavy to post. Then you can take a look at the code to know how I did it.
0 Kudos
KarthikeyanRavi
Beginner
759 Views
I am having the same task. I need to read the RGB pixel value from the sram. But I'm having some doubts , could you provide me the verilog code. My email id : karthickbronson@gmail.com
0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

Sure that would be great! When you store the image using the serial interface does that image get placed in SRAM? Does it store forever? Or will I need to restore everytime game is run? (Ideally it should be store once for my case and then only restore if I need to change the image).

0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

Hi Pachu. 

When I get the image through serial port, it get saved into SRAM, but not forever, since SRAM lost their data when it haven't power supply. 

You could use FLASH for this, but I think this memory will not be enough fast to transfer the data from it to VGA controller, maybe you would need some code for pass the data from FLASH to SRAM first. 

Also you could save in the FLASH more than one image, and then, copy only one to SRAM at a time to show it. 

Here's the top level code, that I used for this. 

Be advice I'm a very beginer in this, so the coding is not very academic, and poor. (but works).
Altera_Forum
Honored Contributor II
1,379 Views

 

--- Quote Start ---  

Pachu. 

What I did ( in example mode) is to upload an image from my computer to the DE2 board using serial port, then I save it in SRAM, and then I show it in the VGA, at 320x240 in 24 bit color. I think it's only difeers from your needs, that you want more than one image.  

I can share the verilog code here, although all quartus project is a bit heavy to post. Then you can take a look at the code to know how I did it. 

--- Quote End ---  

 

 

 

Hi, can send it to me?? I am having this problem now. My email is  

 

Thank you very very much.
0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

kirakiat. 

Look for that code in this thread please. 

Cheers. 

Alberto. 

 

 

--- Quote Start ---  

Hi, can send it to me?? I am having this problem now. My email is  

 

Thank you very very much. 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

 

--- Quote Start ---  

kirakiat. 

Look for that code in this thread please. 

Cheers. 

Alberto. 

--- Quote End ---  

 

 

Do you have any idea that can send image from Matlab to DE2 board? I really need to work on it. Thank you very much.
0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

I really don't have any ideas about Matlab, I never use it.

0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

do you know hw to get image from serial port?? gt any example? Thank you very much,

0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

The example code to send the image by serial port, is in the code of this thread, you should write the PC code by yourself. 

Cheers. 

Alberto.
0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

Hi BTXSistemas,  

 

Thanks for sharing your code, it was quite useful to me.  

I am sending images from memory to compress them via JPEG200 standard (using ADV212 IC), but as you said, SRAM is too small to hold images greather than 240x320 pixels. 

 

Can you tell about your experience using SDRAM? 

 

Regards,
0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

You can use the HDL coder by Mathworks to transform your matlab code to VHDL and then store it in the DE2 board. 

 

www[dot]mathworks[dot]com/products/hdl-coder/
0 Kudos
Reply