Using Papilio with the TV-out wing (newbie to FPGA)


Matt Ownby

Recommended Posts

Hi all,

 

I am big into writing laserdisc arcade game emulators ( http://www.daphne-emu.com ) and emulating laserdisc players ( http://www.laserdisc-replacement.com ).

 

Recently I've becoming interested in learning more about composite video in hopes of generating my own NTSC video signal.

 

Some googling let me to the TV-out project for the Papilio ( http://papilio.cc/index.php?n=Playground.TVOutputWing ).  I am very eager to try this out.

 

I've ordered the parts from the parts list.  One thing though, I am pretty sure based on the parts that I've ordered that I am not going to have any pin headers to plug into the "wing" slot on my Papilio (also recently ordered).  So I am guessing this is missing from the parts list.  Can someone point me to which part this would be so I can solder onto the board when I get it from BatchPCB?  Or.. maybe I am totally misunderstanding how wings work, lol.  I just looked at the batchPCB image and it actually looks different than the parts that I ordered.  *gulp*

 

Also I went through the "getting started" section which installs a "hello world" type program on the Papilio and outputs via the USB serial port.  Got that working just fine.  But when I wanted to go further I was prompted to install an Arduino IDE.  This is where I started to put on the brakes because I thought "Wait a second.. I don't want to write programs that run in an emulated AVR because I have a bunch of real AVR's sitting right here on my desk.  I want to do this VHDL stuff."

 

I notice that the TV-out "wing" provides VHDL source code but I have been unable to find anything on this site (and believe me, I've tried) that explains how to compile a simple "hello world" VHDL program or even what compiler to use!  So this must be such an obvious known fact that no one thought to put it anywhere on the site! lol... but with me being a VHDL newbie, I have no idea which compiler it is that everyone is using.

 

I've seen some references to "Xilinx ISE".  Would that be the compiler?  Or is everyone using something else?

 

Basically I just want to get that TV out wing working so I can start modifying it and learning more about NTSC.

 

Thanks!

--Matt

Link to comment
Share on other sites

Hi Matt,

 

You will require the Xilinx ISE suite of tools to develop HDL designs for the papilio, this includes all of the needed tools to synthesize, place and route and produce programming files for the FPGA.

 

For the pin headers you should be able to use standard 0.1" pitch single in line header and solder them into the PCB.

 

Also compiler isn't really a term used in HDL development since its a somewhat fundamentally different process, you are writing hardware not software.

 

Go to the xilinx website http://www.xilinx.com/  Then to support and downloads, here you will find the downloads for the tools for the FPGA.

 

You will need to register an account with xilinx to download the installer and to get the free WebPack license which can be gotten from Support -> Get licence file on their website.

 

Edit:

 

After you have the tools you can look at hamster's wiki for a VHDL course and book and some other interesting VHDL information here: http://hamsterworks.co.nz/mediawiki/index.php/Main_Page

Link to comment
Share on other sites

And here is a (cough) simple  (cough) "Hello World" program, but for a VGA monitor.

 

http://hamsterworks.co.nz/mediawiki/index.php/Papilio_Plus/Hello_World

 

Oh, and if you download 14.4 do a full install and just install your "free" license key - a partial install forgets to install a lot of useful stuff...

 

For a quick walk-though of the implementation, have a look at https://github.com/hamsternz/IntroToSpartanFPGABook/blob/master/IntroToSpartanFPGABook.pdf?raw=true

Link to comment
Share on other sites

Thanks guys!  I've downloaded the 6 GB xilinx package and have started reading Hamster's writings.  It looks very helpful!

 

EDIT : Wow this PDF has saved me already!  I would've never got passed the "new project" settings dialog where one must change 3-4 settings to use the Papilio with VHDL.

Link to comment
Share on other sites

Dear Hamster (and others who may be interested),

 

I've got some feedback for your excellent PDF book as I have been going through it step by step.  (and since I am a newbie, I may be able to spot some things that veteran proof-readers may gloss over)

 

First of all, thank you for working on this book!  It has saved me a TON of time already!  Just getting the xilinx ISE stuff setup was a life saver!

 

Here are some things I have got hung up on so far:

 

Section 5.1 it says:

 

You want the package called "Full Installer for Windows" or "Full Installer for Linux"-- one of the options given when you run the installer is to install the "cut down" WebPack version.

 

I went ahead and assumed that you were saying we should install the WebPack version, but you may want to reword this from the passive "one of the options given when you run..." to the more assertive "Choose the WebPack version from the list of options."  or something along those lines as I was a little hesitant to proceed here.

 

Also I have just completed section 6 ("Your First Project").  In section 6.3 it tells us to setup some constraints which appears to me to be saying that switch_0 is mapped to P17 on the Papilio, etc.  So far so good.

 

I also successfully built the switches_leds.bit and run it through the papilio programmer.  The window closed so quickly that I couldn't really tell if it succeeded or not but I am assuming it did.  It was pretty fast.  (but it may not have succeeded, how would I tell?)  UPDATE: I have confirmed that I am programming it successfully, see below.

 

But when I get to the end of the section 6, I am expecting some kind of "here's where you plug in on the Papilio board to test it, and here's what kind of voltage you can send through these pins" paragraphs but I didn't find them.

Not wanting to throw my hands up at the first sign of trouble, I attempted to figure this out on my own and I did make a bit of progress but I am stuck.

 

Here's what I've done so far:

 

I found this page (http://www.gadgetfactory.net/blog/wp-content/uploads/2011/02/Papilio_Pins.png) which I am assuming is accurate.  I believe I've found the right holes to plug in at.  UPDATE: I've confirmed that I've found the right holes, see below.

 

As I have the Papilio which has no LEDs or buttons on it, I decided to try to use my Atmel STK600 ( http://www.atmel.com/tools/stk600.aspx ) board which has both buttons and LEDs built into it.  The buttons are active low as are the LEDs, but I figure this shouldn't matter (although if it does, that would be good information to know).

 

So I plug in a wire from the STK600's button 0 into P4 which means I now have 5V going into P4.

 

Then I plug another wire from P17 into LED0 on the STK600.  The LED instantly lights up meaning it is getting GND basically.  This is not what I am expecting to happen.

 

So I remove the wire from P17 and plug it into my oscilloscope.  I am seeing nothing but 0V here even if I press the button 0 on the STK600.  In other words, nothing seems to be happening.

 

Then I try just plugging in 5V, 3.3V, 2.5V from the Papilio pins into P4 just to see if I can see _something_ change on P17.  Still nothing.  (incidentally, is this bad?  I saw nothing in the PDF about what kind of voltages are safe to use on these pins.  If there are constraints, that might be a good idea to add in the tutorial! hehehe)

 

Any help would be appreciated.

 

UPDATE: I tried changing "LED_0 <= switch_0" to "LED_0 <= '1'" and I was able to see about 3.1V (3.3V?  probably lower because I am using the USB power) on my scope on P17.  so this means I am programming my FPGA successfully.

Also, I changed the .ucf file so that LED_0 points to P4 instead of P17 and again I am now seeing 3.1V on P4 as an output.  So I can therefore conclude:

- I am programming the FPGA successfully

- I have located P17 and P4 successfully

 

UPDATE #2: Ok I think I solved my own questions here.  But thanks for letting me talk through this! :)

- Still a little confused about what LVTTL means.  Does that mean it only works with 3.3V-GND ?

- Verified (using scope) that P4 will output to P17 both GND and 3.3V (I just plugged a wire from the 3.3V hole to P4 and got it working).  I am not going to attempt 5V again until someone tells me whether it is safe.  I can settle for 3.3V now for my testing.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.