How can Papilio fpga board be used without any wings ?


hencre

Recommended Posts

hi,

 

I want to get started with FPGA.

 

How can Papilio One - 500k board be used without wings. Can input be read from usb port ( same as programming port) and output on serial port ? Could you point to or give a simple example having this setup ( vhdl/verilog file + ucf file would be helpful ).

 

Cheers

Link to comment
Share on other sites

Hi Hencre! 

 

Yes, it can work exactly as you describe. In fact sending RS232 from the P1 was used as a puzzle for a giveaway here at GadgetFactory. Here is the code;

--------------------------------------------------------------------------------- Use the following constraints on a Papilio One-- NET "clk"	 LOC = "P89" | IOSTANDARD = LVCMOS25;-- NET "mystery" LOC = "P90" | IOSTANDARD = LVCMOS25 | DRIVE = 4 | SLEW = SLOW;-------------------------------------------------------------------------------library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.NUMERIC_STD.ALL;entity mystery isPort ( clk	 : in STD_LOGIC;		 mystery : out STD_LOGIC);end mystery;architecture Behavioral of mystery issignal counter : unsigned ( 11 downto 0) := (others => '0');signal shift : std_logic_vector(135 downto 0) := x"FC255346D1B5ED025D57B49D1B44D584A1";beginmystery <= shift(135);	process(clk)begin	 if rising_edge(clk) then		 if counter = 3332 then			 counter <= (others => '0');			 shift <= shift(134 downto 0) & shift(135);		 else			 counter <= counter+1;		 end if;	 end if;end process;end Behavioral;

Receiving is a little harder :-)

Link to comment
Share on other sites

hi Hamster,

 

I tried to run your code.

Here P90 = RX led. Is it supposed to blink after I write the bit file to the board ?

 

Also, how can I transmit contents of shift register on serial port and view contents of shift register using putty  ?

 

Appreciate your help.

 

Cheers.

Link to comment
Share on other sites

Hi,

 

I would expect the led to blink.

 

That code should send "Hello World" at 9600 baud (32,000,000 / (3332+1)) - where 3332 is from the "if" statement in the code. 

 

You should just be able to open Putty, set it to the correct serial port at 9800,8,n,1.

 

One thing worthwhile would be to check the "Pinout Report" (fifth entry down in the tree to the left of the "Design Summary" window), just to check that the correct signals are located on the correct pin.

 

If not, then you need to doublecheck the projects '.ucf' file.

Link to comment
Share on other sites

hi Hamster,

 

It works...I can see Hello world constantly printed on the screen..Thanks so much!

 

One last thing, is it possible to send dynamic inputs from the keyboard at each run.

Say there is a vhdl code for fibonacci sequence of n elements ( parameter n varies at each run )

how to take parameters as input ?

 

Appreciate all your help.

 

Thanks a ton !

Link to comment
Share on other sites

It might be a bit epic for what you need but http://hamsterworks.co.nz/mediawiki/index.php/CheapScope#transmitter.vhd transmits the contents of a RAM block in ASCII, with newlines and so on.

 

The general idea is to set up a 10 bit shift register, and every 1/9600th of a second shift the MSB to the TX output, and shift in a '1' for the LSB.

 

Then every 1/960th of a second load the shift register with '0' & ascii_code & '1'   (start bit, data, stop bit). 

 

The TX line should be held high when idle (which is why a '1' is shifted in for the LSB).

Link to comment
Share on other sites

Archived

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