Recommended Posts

Hi,

I have a mojo V3 and have to design a device that simply takes an image from the PC, using the UART connection already present on the board and displays it on a VGA monitor. My Professor needs me to do this as a test so that i can assist him on larger projects.

I wanted to know exactly how to send RAW data from my PC to the board where i can save it in registers. I have not done anything like this before so lots of details might help! 

 

Thanks a lot! :)

Share this post


Link to post
Share on other sites

I don't think that would be an issue. I just need to know how to get data over a UART for a FPGA using Verilog.

I guess that is the same for all boards. right?

Share this post


Link to post
Share on other sites

Well, the HDL would be the same but the solution would not be. Any example I could point you to would most likely include the ZPUino soft processor which hasn't been ported to the Mojo. It would also use the Arcade MegaWing or the VGA Wing for the hardware which is not available for the Mojo.

 

I certainly don't mind you asking your question here, I just didn't want there to be no reply...

 

Maybe someone has a HDL only solution that they can point you to, or go to www.gadgetfactory.net and use the search box to see what VGA projects are already available. 

 

Jack.

Share this post


Link to post
Share on other sites

Here's a rough outline of how I'd approach this problem, and a dump of a few "places to look" for various details.

 

The general approach is:

1. Figure out what you've got already decided for you; what you're pretty much free to find somewhere; and what you're expected to put together for yourself.  That's going to depend on what your Professor wants and what you're being tested on.  Generally the "parts" for this are:

    a. The FPGA board.  That's already decided for you: Mojo v3

    b. Wiring on the VGA side.  That may already be done for you (in the form of an I/O board that plugs into the Mojo), or maybe you're expected to design and put one together.  The schematic of the Arcade MegaWing might give you some ideas (http://papilio.cc/index.php?n=Papilio.ArcadeMegaWing).

    c. Wiring on the serial-port side.  Sounds from what you're saying like that's chosen for you.

    d. What protocol you're going to use for transmitting the image from computer to FPGA, over the serial port.  Could be simple, or fancy.  Could be standard, or roll-your-own.  Could be decided for you, or you could be free to come up with your own.

    d. The RTL (Verilog or VHDL) for the serial port communication.  There are plenty already implemented, or if you have to do your own, it's not impossible (was my first substantial project).

    e. The RTL (Verilog or VHDL) for the VGA output.  There are plenty already implemented, or you can do your own.

    f. Memory to store the image while it's on the FPGA.  Almost certainly this is whatever memory is built into your FPGA.  The one that's used in the Mojo, and in the Papilio Pro, has ~64kB.  That's enough for 800x600x1bpp, or 400x300x4bpp, or so on.  Off-FPGA memory is also possible, but more painful to work with, even on a board (such as the Papilio Pro) that has it.

2. For each, if it's decided for you: Figure out how it interacts with the other parts.  If you're free to choose: Pick one, figure out how it will interact with the other parts.  If you have to make your own: Figure out how it should interact with the other parts; and how it should work.

3. Go for it.

 

Now for the dump of sources of information:

http://tinyvga.com/vga-timing -- lists VGA timing parameters

http://www.fpga4fun.com -- walks you through a few sample designs

http://opencores.org/project,uart2bus -- Verilog for a way to send data (not quite "raw") over a serial port into various registers.  I haven't used it, but I've used something similar, and it's quite convenient.

http://www.digilentinc.com -- The manuals for this company's FPGA boards also include overviews of various I/Os such as VGA and serial ports.

 

Random other thoughts:

Debugging.  You're almost certain to have to do debugging.  If you use something like uart2bus to access your FPGA design "like memory," you can use it not only to transfer image data from host to FPGA, but also to transfer whatever debugging information you want to collect, back to the host, where you can display and examine it more conveniently.

There's also dealing with the tools (Xilinx ISE is the one I've been using) and whatever they need just to tie things together.

On Xilinx there's the "constraints file" (suffix UCF) which identifies what pins on the FPGA go to what (named) connections in your Verilog code, among other things like their electrical and timing characteristics.  If an I/O board is provided for you, containing the VGA port, then there's probably a UCF file to go with it you can copy and start working with.

 

Share this post


Link to post
Share on other sites

You may also want to break it down into smaller chunks, that you can put together into a working project.

 

First start with turning on some LEDs, then....

 

a: Can you receive a single byte from the PC and display it on some LEDs?

 

b: Can you generate a VGA test picture?

 

c: Can you make a memory and play back a pattern onto LEDs?

 

Then you can build

 

a+b:  Can you store bytes from the PC into a memory?

 

b+c: Can you display a picture from memory?

 

Then finally

 

a+b+c: Taking data from the host, storing it in memory, and displaying it on the screen.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now