EmbDev.net

Forum: FPGA, VHDL & Verilog SD card picture to VGA screen


von Tom B (Guest)


Rate this post
useful
not useful
Hello guys!
I have a development board of cyclone 2 DE2...
It has an SD card input and a VGA output. My screens resolution is 
1440-900. It is also a touch screen with 4 outputs(X+ , X- , Y+ , Y-).
There are options that I could think of, If you can please tell me the 
easiest one and if you could how to do it!

The first option is to upload pics to my SD card that will be shown 
directly on the vga screen.
What I want is so one picture will be shown that has "links" to other 
pictures:
------------------------------------
-   1                          2   -
-                                  -
-                                  -
-   3                          4   -
------------------------------------
( The links will be determent by the axis of the touch screen: X+, X-, 
Y+, Y-... like: 15, 30, 40, 55)
The number I press is the number of the picture( all I want to know is 
the concept of how to choose the location and teach the fpga board to 
know)
if I press 1 a picture will be shown. The same for 2, 3 and 4.
the pictures can be named like: 1.png, 2.png ... (If they have to be 
jpeg or a different one please tell me).
And if I press the screen again it will come back to the first one.

The second option
The same idea of the program but I have the program "WinHex" which turns 
pictures to Hex code. can It be my picture instead the png or the jpeg?

If there is an easier way please tell me. Also, please give my tips on 
how to do it!
Thanks for all helpers!

von phaser (Guest)


Rate this post
useful
not useful
To use files, you will need a file system like FAT. Doing SD-Card + FAT 
in Hardware without a processor/softcore will be a major pain!

So I think your second option is better! I think you can read arbitrary 
addresses of the SD card over SPI, so reading a "file" is simply a 
matter of reading from the right address - much easier! The harder part 
will be getting the data from your PC onto the SD-Card in this plain 
format without a filesystem... I'm not sure Windows will allow you to do 
this, I'm thinking Linux + something like dd should work.

von Tom B (Guest)


Rate this post
useful
not useful
Is there a way I can do that program in any way possible? Most 
important, it cannot be connected to any computer, so linux cant be 
used...

von Tom B (Guest)


Rate this post
useful
not useful
Also I didnt mention but I HAVE TO use vhdl and not verilog or any other 
programming language!

von hfuahif (Guest)


Rate this post
useful
not useful
Tom B wrote:
> Is there a way I can do that program in any way possible? Most
> important, it cannot be connected to any computer, so linux cant be
> used...

Best way would be to use a small 8bit softcore which access your sdcard 
... There are plenty of FAT libraries for e.g. AVR and there also is a 
AVR softcore.

And you don't need linux for ...

Only task left is how to display content read from the SD-Card on the 
monitor ...

von Tom B (Guest)


Rate this post
useful
not useful
Can you tell me how does the FAT works? Like, is it just fetching the 
pictures or will it break them down to every bit and color of each one?

von Tom B (Guest)


Rate this post
useful
not useful
Hey guys!
So I was browsing the internet and I have found a program which I can 
choose a picture and it will break it down to every pixel and its color 
in hex... How can I save each (long) row of hex code as one picture and 
to be able to  choose between different pictures which will also be long 
rows of raw code?
If I'll be able to do that I have this in the pocket!

von hfuahif (Guest)


Rate this post
useful
not useful
Choose the right image format ... TIFF is afaik uncompressed ...

BMP also can be stored uncompressed ... Still, there are some headers.

Alternatively, you could spend 2h learning a programming language like 
java and decompress and save your images in raw format on a sdcard 
sector-wise ... Then you won't have to have FAT or a image decompression 
algorithm ...

But unfortunately, completly without work done by you, there is no 
solution ;)

von mosaco (Guest)


Rate this post
useful
not useful
I think he could also merge all his hex file into a large text file as a 
container using hex editor and copy that text in to the formatted sd 
card.

von Tom B (Guest)


Rate this post
useful
not useful
And how can I extract the text and convert it to a picture?

von Jonas B. (jibi)


Rate this post
useful
not useful
You don't need to extract - you need to interprete the stream of bytes. 
And with a known format (like bmp) you know the meaning of each byte in 
the stream.

Greetz J

von Jonas B. (jibi)


Rate this post
useful
not useful
Just to mentioned I made something similar and know that there is a tool 
WINHEX Pro, that is able to write raw data streams to sd-cards.

von Tom B (Guest)


Rate this post
useful
not useful
Ok... after I have uploaded the bmp file to the sd card, how can I 
tranfer  it to the vga?

von Duke Scarring (Guest)


Rate this post
useful
not useful
Tom B wrote:
> how can I
> tranfer  it to the vga?
Split your task in two:
1. generate VGA signals from display memory
2. read SD card an put data into the display memory

Duke

von Tom B (Guest)


Rate this post
useful
not useful
The only thing I donk know Is how to READ the data from the sd card!
Can anyone explain it to me?

von hfuahif (Guest)


Rate this post
useful
not useful
Tom B wrote:
> The only thing I donk know Is how to READ the data from the sd card!
> Can anyone explain it to me?

You have to implement an SPI-interface for communicating with the sd 
card, then you have to implement a state machine which uses the 
interface for reading sectors from the sd card.

There are tons of information about sd card and spi-interface ...

Do you want me to google you this information? ;-)

von hfuahif (Guest)


Rate this post
useful
not useful
I'm glad to be of service ...

http://www.dejazzer.com/ee379/lecture_notes/lec12_sd_card.pdf

Happy coding!

von Tom B (Guest)


Rate this post
useful
not useful
Hope this works. You have been a great help.
Thank-you!!!

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.