Forum Discussion
12 Replies
- Altera_Forum
Honored Contributor
Not so easy, not so fast :-)
Start with VGA signal synthesis: http://www.fpga4fun.com/ponggame.html Then move to SD card interfacing: http://opencores.org/project,sdcard_mass_storage_controller Then add a CPU system: NIOS Then add FAT file system: http://elm-chan.org/fsw/ff/00index_e.html From now on, it's all software stuff :-) - Altera_Forum
Honored Contributor
Pretty good task for a pure verilog implementation. I'm assuming this means you can't instantiate a NIOS cpu core and write some C code.
First things first, is how can you simply the problem. What Image format must it be in. If you can choose one, choose the simplest, (BMP or PPM), then if you don't have to have a FAT system, don't, just write the data raw to the SD card at a specific offset so you can READ it raw from the SD. Then store it in a faster memory, (internal if you can), so that you can loop the output and not have video underrun's when displaying the image. Once you have the simplest form running, you can start looking into more advanced features, like dealing with FAT tables, and different image formats, etc. Pete - Altera_Forum
Honored Contributor
Hi Pete
At first i am not using NIOS at all. I will choose simple image format as you told. Which is the best protocol to read from sd card and if you have some link with or without code to help me with. A.A - Altera_Forum
Honored Contributor
The 'best' protocol for speed is to implement the nibble (4-bit) wide interface SD cards support. However, the 'best' protocol for simplicity (probably the one you want) is the standard SPI interface SD cards also support. 3 signals driven into the SD card (clock, data in and chip select) and one return signal (data out). All transactions are byte (8-bit) based.
The following link takes you to a page with plenty of information on using the SPI protocol with SD cards: http://elm-chan.org/docs/mmc/mmc_e.html (http://elm-chan.org/docs/mmc/mmc_e.html) Assuming you run the interface at 25MHz and you store uncompressed data in the SD card, you should be able to read out a standard VGA image in around 30ms. Higher definition images will take proportionally longer. - Altera_Forum
Honored Contributor
Thanks for the link it help me a lot ... now about vga i have to make 2 files? one for the sync and one for colours?
- Altera_Forum
Honored Contributor
I'm not sure you need two files. Every image will need to be driven to the display with the appropriate vertical & horizontal sync control. This timing control is more likely to come directly from the control logic in your FPGA.
If you're only trying to display a simple colour bars image on screen then I'd suggest you don't even need an SD card to store it. Assuming that is what you intend, and you know the size of the image you're trying to deliver (e.g. VGA), then you can create a colour bars screen entirely in the FPGA. A small state machine or counter is used to deliver the correct number of pixels before changing colour. Vertical and horizontal sync signals will drop out from the same controlling logic. You will only need the storage if you're trying to store an image, rather than a regular pattern. Regards, Alex - Altera_Forum
Honored Contributor
Thanks for the post Alex.
i choose to have a simple image format which i will show into the display (gray scale) and store it from sd to fpga so i don't have to connect ram. I make the calculations and it fits. The problem i have is with h_sync and v_sync which i don't know how to use them.Any help would be like gold... - Altera_Forum
Honored Contributor
http://lslwww.epfl.ch/pages/teaching/cours_lsl/ca_es/vga.pdf (http://lslwww.epfl.ch/pages/teaching/cours_lsl/ca_es/vga.pdf)
It even has some code for you to use...:cool: - Altera_Forum
Honored Contributor
thank you very much it is what i needed ..
- Altera_Forum
Honored Contributor
I am too building a very similar project on a de0 nano board, but i need to do some image processing with it too.
Would be really grateful if you could provide the verilog code, or alternatively some other help