Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21602 Discussions

How to input an existing image file into the FPGA

Altera_Forum
Honored Contributor II
3,754 Views

I'm very new to FPGA's 

so I was wondering, what are the possible methods of entering an image into an FPGA device? 

I'm using a DE2 board by the way. 

I wish to place the image in a mass storage device then let the FPGA read it for image processing.. 

currently wish the image to be *.bmp but any suggestions will be very much welcomed. 

SO anyone have any suggestions on how I can get the image from a mass storage device? 

(currently no specific mass storage device of choice so any will do) 

Please and Thank you
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
2,666 Views

I have done this before. 

 

when I was new I did not have way to read bmp file on the FPGA. 

therefore I made C program which make bmp.h file from bitmap(raw) binary image. 

also I made C program which works on the NiosII. 

the NiosII program writes the data from bmp.h into flash-memory. 

after that, another NiosII program reads the image from flash to use. 

 

if you know a lot about ethernet / SD card or some other way. 

you can put image from LAN or SD card / USB and so on. 

 

the way I wrote is not professional but still works. 

 

see you.
0 Kudos
Altera_Forum
Honored Contributor II
2,666 Views

You also have the option to use the read-only zip filesystem (http://www.altera.com/literature/hb/nios2/n2sw_nii52012.pdf). You put your bmp file in an uncompressed .zip file, flash that file to a specific location, and enable the filesystem option in Eclipse. Then you'll be able to read your file with the standard file functions.

0 Kudos
Altera_Forum
Honored Contributor II
2,666 Views

thank you for the replies... 

Honestly, I still don't fully understand what you guys said but I'm reading on it to get the idea.. 

Ahmmm, so this flash-memory, is this an external source or is this already part of the FPGA? 

*still reading on this just now so sorry if my questions are a little silly
0 Kudos
Altera_Forum
Honored Contributor II
2,666 Views

nevermind about the flash... i found out it is a memory of the FPGA.. 

sorry, 

 

anyways, so in what specific ports can I download these files?  

can it be done on the SD card or USB port?
0 Kudos
Altera_Forum
Honored Contributor II
2,666 Views

The DE2 board has two flash chips, external to the FPGA: an EPCS chip that is used to configure the FPGA, and a regular CFI flash that can hold the software and a readonly zip file system. 

The zip filesystem is probably the easiest way to do this, you can use the Nios programmer to flash the zip file in the DE2's flash memory. The SD card solution is a bit more complex, and the USB solution is probably the most difficult. Check if you have example designs with the kit that uses one of those solutions.
0 Kudos
Altera_Forum
Honored Contributor II
2,666 Views

I have done it ,I get a hex-data of *.bmp from MATLAB,and to initial a rom of DE2 device,then I read the image data from rom ,and display by VGA;I also have used SD to display ,that using niosII and filesystem,you can read the datasheet form altera official website.

0 Kudos
Reply