UART Demo on Papilio Pro


Bytter

Recommended Posts

Hi,

 

I've tried following your tutorial on getting the UART demo running on the Papilio, but it seems things are a little different with the 'Pro' version. Particularly, the Spartan 6 version of the Microblaze doesn't seem to have the VHDL top-level directory, and when importing the UART files it fails to synthesize. Any thoughts? 

Link to comment
Share on other sites

Ok, the following was as far as I could go. I used the Xilinx's KCPSM6 for the uart_tx and rx, and configured the UCF for the Papilio Pro but I still don't receive any kind of echo in the COM port. Here's the code:

 

 

library IEEE;use IEEE.STD_LOGIC_1164.ALL;library UNISIM;use UNISIM.VComponents.all;entity UARTExample is    Port (     rx : in  std_logic;               tx : out std_logic;LED1 : out std_logic; extclk : in  std_logic);end UARTExample;architecture Behavioral of UARTExample iscomponent uart_tx6 isport (             data_in : in  std_logic_vector(7 downto 0); buffer_write : in  std_logic; buffer_reset : in  std_logic; en_16_x_baud : in  std_logic;buffer_data_present : out std_logic;serial_out : out std_logic;buffer_full : out std_logic;buffer_half_full : out std_logic; clk : in  std_logic);end component; component uart_rx6 is  port (            serial_in : in  std_logic;                  buffer_read : in  std_logic;                 buffer_reset : in  std_logic;    en_16_x_baud : in  std_logic;                          clk : in  std_logic;                     data_out : out std_logic_vector(7 downto 0);          buffer_data_present : out std_logic;      buffer_half_full : out std_logic;                  buffer_full : out std_logic);end component; COMPONENT dcm32to96PORT(CLKIN_IN : IN std_logic;          CLKFX_OUT : OUT std_logic;CLKIN_IBUFG_OUT : OUT std_logic;CLK0_OUT : OUT std_logic);END COMPONENT; signal dout : STD_LOGIC_VECTOR (7 downto 0);signal data_present, en_16_x_baud, clk : STD_LOGIC;signal baud_count : integer range 0 to 5 :=0;beginbaud_timer: process(clk)beginif clk'event and clk='1' thenif baud_count=1 thenbaud_count <= 0;en_16_x_baud <= '1';elsebaud_count <= baud_count + 1;en_16_x_baud <= '0';end if;end if;end process baud_timer;impl_uart_tx: uart_tx6port map (   data_in => dout,   buffer_write => data_present,   buffer_reset => '0',   en_16_x_baud => en_16_x_baud,   clk => clk,   serial_out => tx,buffer_data_present => LED1,buffer_half_full => open,   buffer_full => open);impl_uart_rx6 : uart_rx6port map (   serial_in => rx,   buffer_read => '1',   buffer_reset => '0',   en_16_x_baud => en_16_x_baud,   clk => clk,   data_out => dout,   buffer_data_present => data_present,buffer_half_full => open,buffer_full => open);Inst_dcm32to96: dcm32to96 PORT MAP(CLKIN_IN => extclk,CLKFX_OUT => clk,CLKIN_IBUFG_OUT => open,CLK0_OUT => open); end Behavioral;
Link to comment
Share on other sites

And the corresponding UCF:

 

 

## Prohibit the automatic placement of pins that are connected to VCC or GND for configuration.CONFIG PROHIBIT=P144;CONFIG PROHIBIT=P69;CONFIG PROHIBIT=P60;NET "extclk"       LOC="P94"  | IOSTANDARD=LVTTL | PERIOD=31.25ns;               # CLKNET "rx"           LOC="P101" | IOSTANDARD=LVTTL | DRIVE=8 | SLEW=FAST;          # RXNET "tx"           LOC="P105" | IOSTANDARD=LVTTL | DRIVE=8 | SLEW=FAST | PULLUP; # TX
Link to comment
Share on other sites

Actually... The above code works pretty well... The thing is that the configured baud rate is 3000000 (3Mbit/s!!!). I've pushed the papilio pro's migration to here: https://github.com/hugoferreira/uart-example-papilio-pro

I searched Gadget Factory's github for a repo to fork this code, but I couldn't found it. If there exists such a repo, please drop a note and I'll do a pull request.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.