اطلاعیه

Collapse
No announcement yet.

کار با برد fpga spartan-6 موجود در فروشگاه

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    کار با برد fpga spartan-6 موجود در فروشگاه

    سلام به همگی
    من تازه میخوام fpga کار کنم . میخوام یه تراز دیجیتال بسازم .برد موجود در فروشگاه رو تهیه کردم .
    برای ساخت نیاز به راه اندازی سنسور ژیروسکوپ و راه اندازی پورت VGA و مانیتور کردن شکل تراز !
    اگر کسی میتونه کمک ام کنه که چطور شروع کنم ممنون میشم.

    #2
    پاسخ : کار با برد fpga spartan-6 موجود در فروشگاه

    من چند سال پیش که vhdl یکم کار میکردم با نرم افزار tina که شبیه به پروتئوس بود کد هامو تست میکردم
    چند تا مثال برات میفرستم برای کار با vga



    LIBRARY IEEE;
    USE IEEE.STD_LOGIC_1164.ALL;
    USE IEEE.STD_LOGIC_ARITH.ALL;
    USE IEEE.STD_LOGIC_UNSIGNED.ALL;


    --********************************************
    ENTITY vga is
    PORT(
    clk,orient : IN STD_LOGIC;
    hs,vs,r,g,b: out std_logic
    );
    END vga;


    --*********************************************
    ARCHITECTURE behv OF vga IS
    signal clk_int :std_logic_vector(1 downto 0);
    signal hs1,vs1,fclk,cclk: STD_LOGIC;
    signal mmd: STD_LOGIC_vector(1 downto 0);
    signal fs: STD_LOGIC_vector(3 downto 0);
    signal cc: STD_LOGIC_vector(4 downto 0);
    signal ll: STD_LOGIC_vector(8 downto 0);
    signal grbx: STD_LOGIC_vector(3 downto 1);
    signal grby: STD_LOGIC_vector(3 downto 1);
    signal grbp: STD_LOGIC_vector(3 downto 1);
    signal grb: STD_LOGIC_vector(3 downto 1);

    BEGIN
    PROCESS(CLK)
    begin
    if(clk'event and clk='1')then
    clk_int<=clk_int+1;
    end if;
    end process;
    grb(2)<=(grbp(2) xor orient) and hs1 and vs1;
    grb(3)<=(grbp(3) xor orient) and hs1 and vs1;
    grb(1)<=(grbp(1) xor orient) and hs1 and vs1;
    process(orient)
    begin
    if orient'event and orient='0' then
    if mmd="10" then
    mmd<="00";
    else
    mmd<=mmd+1;
    end if;
    end if;
    end process;
    process(mmd)
    begin
    if mmd="0" then
    grbp<=grbx;
    elsif mmd="01" then
    grbp<=grby;
    elsif mmd="10" then
    grbp<=grbx xor grby;
    else
    grbp<="000";
    end if;
    end process;
    process(clk_int(1))
    begin
    if clk_int(1)'event and clk_int(1)='1' then
    if fs=24 then
    fs<="0000";
    else
    fs<=fs+1;
    end if;
    end if;
    end process;
    fclk<=fs(2);
    process(fclk)
    begin
    if fclk'event and fclk='1' then
    if cc=48 then
    cc<="00000";
    else
    cc<=cc+1;
    end if;
    end if;
    end process;
    cclk<=cc(4);
    process(cclk)
    begin
    if cclk'event and cclk='0' then
    if ll=481 then
    ll<=(others=>'0');
    else
    ll<=ll+1;
    end if;
    end if;
    end process;
    process(cc,ll)
    begin
    if cc>23 then
    hs1<='0';
    else
    hs1<='1';
    end if;
    if ll>479 then
    vs1<='0';
    else
    vs1<='1';
    end if;
    end process;
    process(cc,ll)
    begin
    if c<3 then grbx<="111";
    elsif cc<6 then grbx<="110";
    elsif cc<9 then grbx<="101";
    elsif cc<12 then grbx<="100";
    elsif cc<15 then grbx<="011";
    elsif cc<18 then grbx<="010";
    elsif cc<21 then grbx<="001";
    else grbx<="000";
    end if;
    if ll<60 then grby<="111";
    elsif ll<120 then grby<="110";
    elsif ll<180 then grby<="101";
    elsif ll<240 then grby<="100";
    elsif ll<300 then grby<="011";
    elsif ll<360 then grby<="010";
    elsif ll<420 then grby<="001";
    else grby<="000";
    end if;
    end process;
    hs<=hs1;
    vs<=vs1;
    r<=grb(2);
    g<=grb(3);
    b<=grb(1);
    end behv;




    دلیل: ادغام دو پست برای جلوگیری از اسپم

    اگه با سگمنت کار میکنی این کد میتونه کمکت کنه

    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    use IEEE.STD_LOGIC_ARITH.ALL;
    use IEEE.STD_LOGIC_UNSIGNED.ALL;


    ENTITY seg70 IS
    PORT (
    clk : IN std_logic;
    rst : IN std_logic;
    dataout : OUT std_logic_vector(7 DOWNTO 0);
    en : OUT std_logic_vector(7 DOWNTO 0));
    END seg70;


    ARCHITECTURE arch OF seg70 IS


    signal cnt_scan : std_logic_vector(15 downto 0 );
    signal data4 : std_logic_vector(3 downto 0);
    signal dataout_xhdl1 : std_logic_vector(7 downto 0);
    signal en_xhdl : std_logic_vector(7 downto 0);
    begin
    dataout<=dataout_xhdl1;
    en<=en_xhdl;
    process(clk,rst)
    begin
    if(rst='0')then
    cnt_scan<="0000000000000000";
    elsif(clk'event and clk='1')then
    cnt_scan<=cnt_scan+1;
    end if;
    end process;

    process(cnt_scan(15 downto 13))
    begin
    case cnt_scan(15 downto 13) is
    when"000"=> en_xhdl<="11111110";
    when"001"=> en_xhdl<="11111101";
    when"010"=> en_xhdl<="11111011";
    when"011"=> en_xhdl<="11110111";
    when"100"=> en_xhdl<="11101111";
    when"101"=> en_xhdl<="11011111";
    when"110"=> en_xhdl<="10111111";
    when"111"=> en_xhdl<="01111111";
    when others=> en_xhdl<="11111110";
    end case;


    end process;


    process(en_xhdl)
    begin
    case en_xhdl is
    when "11111110"=> data4<="0000";
    when "11111101"=> data4<="0001";
    when "11111011"=> data4<="0010";
    when "11110111"=> data4<="0011";
    when "11101111"=> data4<="0100";
    when "11011111"=> data4<="0101";
    when "10111111"=> data4<="0110";
    when "01111111"=> data4<="0111";
    when others => data4<="1000";
    end case;
    end process;


    process(data4)
    begin
    case data4 is
    WHEN "0000" =>
    dataout_xhdl1 <= NOT"00000011";
    WHEN "0001" =>
    dataout_xhdl1 <= NOT"10011111";
    WHEN "0010" =>
    dataout_xhdl1 <= NOT"00100101";
    WHEN "0011" =>
    dataout_xhdl1 <= NOT"00001101";
    WHEN "0100" =>
    dataout_xhdl1 <= NOT"10011001";
    WHEN "0101" =>
    dataout_xhdl1 <= NOT"01001001";
    WHEN "0110" =>
    dataout_xhdl1 <= NOT"01000001";
    WHEN "0111" =>
    dataout_xhdl1 <= NOT"00011111";
    WHEN "1000" =>
    dataout_xhdl1 <= NOT"00000001";
    WHEN "1001" =>
    dataout_xhdl1 <= NOT"00011001";
    WHEN "1010" =>
    dataout_xhdl1 <= NOT"00010001";
    WHEN "1011" =>
    dataout_xhdl1 <= NOT"11000001";
    WHEN "1100" =>
    dataout_xhdl1 <= NOT"01100011";
    WHEN "1101" =>
    dataout_xhdl1 <= NOT"10000101";
    WHEN "1110" =>
    dataout_xhdl1 <= NOT"01100001";
    WHEN "1111" =>
    dataout_xhdl1 <= NOT"01110001";
    WHEN OTHERS =>
    dataout_xhdl1 <= NOT"00000011";

    END CASE;
    END PROCESS;
    end arch;


    اگه با lcd کار میکنی این کد کمکت میکنه


    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    use IEEE.STD_LOGIC_ARITH.ALL;
    use IEEE.STD_LOGIC_UNSIGNED.ALL;






    entity lcd is
    Port ( clk : in std_logic; --40MHZ
    Reset : in std_logic;
    lcd_rs : out std_logic;
    lcd_rw : out std_logic;
    lcd_e : buffer std_logic;
    data : out std_logic_vector(7 downto 0)
    -- stateout: out std_logic_vector(10 downto 0);
    );
    end lcd;




    architecture Behavioral of lcd is


    constant IDLE : std_logic_vector(10 downto 0) :="00000000000";
    constant CLEAR : std_logic_vector(10 downto 0) :="00000000001";
    constant RETURNCURSOR : std_logic_vector(10 downto 0) :="00000000010" ;
    constant SETMODE : std_logic_vector(10 downto 0) :="00000000100";
    constant SWITCHMODE : std_logic_vector(10 downto 0) :="00000001000";
    constant SHIFT : std_logic_vector(10 downto 0) :="00000010000";
    constant SETFUNCTION : std_logic_vector(10 downto 0) :="00000100000";
    constant SETCGRAM : std_logic_vector(10 downto 0) :="00001000000";
    constant SETDDRAM : std_logic_vector(10 downto 0) :="00010000000";
    constant READFLAG : std_logic_vector(10 downto 0) :="00100000000";
    constant WRITERAM : std_logic_vector(10 downto 0) :="01000000000";
    constant READRAM : std_logic_vector(10 downto 0) :="10000000000";








    constant cur_inc : std_logic :='1';
    constant cur_dec : std_logic :='0';
    constant cur_shift : std_logic :='1';
    constant cur_noshift : std_logic :='0';
    constant open_display : std_logic :='1';
    constant open_cur : std_logic :='0';
    constant blank_cur : std_logic :='0';
    constant shift_display : std_logic :='1';
    constant shift_cur : std_logic :='0';
    constant right_shift : std_logic :='1';
    constant left_shift : std_logic :='0';
    constant datawidth8 : std_logic :='1';
    constant datawidth4 : std_logic :='0';
    constant twoline : std_logic :='1';
    constant oneline : std_logic :='0';
    constant font5x10 : std_logic :='1';
    constant font5x7 : std_logic :='0';


    signal state : std_logic_vector(10 downto 0);
    signal counter : integer range 0 to 127;
    signal div_counter : integer range 0 to 15;
    signal flag : std_logic;
    constant DIVSS : integer :=15;


    signal char_addr : std_logic_vector(5 downto 0);
    signal data_in : std_logic_vector(7 downto 0);
    component char_ram
    port( address : in std_logic_vector(5 downto 0) ;
    data : out std_logic_vector(7 downto 0)
    );
    end component;




    signal clk_int: std_logic;


    signal clkcnt: std_logic_vector(18 downto 0);
    constant divcnt: std_logic_vector(18 downto 0):="1111001110001000000";
    signal clkdiv: std_logic;
    signal tc_clkcnt: std_logic;
    begin


    process(clk,reset)
    begin
    if(reset='0')then
    clkcnt<="0000000000000000000";
    elsif(clk'event and clk='1')then
    if(clkcnt=divcnt)then
    clkcnt<="0000000000000000000";
    else
    clkcnt<=clkcnt+1;
    end if;
    end if;
    end process;
    tc_clkcnt<='1' when clkcnt=divcnt else
    '0';


    process(tc_clkcnt,reset)
    begin
    if(reset='0')then
    clkdiv<='0';
    elsif(tc_clkcnt'event and tc_clkcnt='1')then
    clkdiv<=not clkdiv;
    end if;
    end process;












    process(clkdiv,reset)
    begin
    if(reset='0')then
    clk_int<='0';
    elsif(clkdiv'event and clkdiv='1')then
    clk_int<= not clk_int;
    end if;
    end process;


    process(clkdiv,reset)
    begin
    if(reset='0')then
    lcd_e<='0';
    elsif(clkdiv'event and clkdiv='0')then
    lcd_e<= not lcd_e;
    end if;
    end process;


    aa:char_ram
    port map( address=>char_addr,data=>data_in);


    lcd_rs <= '1' when state =WRITERAM or state = READRAM else '0';
    lcd_rw <= '0' when state =CLEAR or state = RETURNCURSOR or state=SETMODE or state=SWITCHMODE or state=SHIFT or state= SETFUNCTION or state=SETCGRAM or state =SETDDRAM or state =WRITERAM else
    '1';
    data <="00000001" when state =CLEAR else
    "00000010" when state =RETURNCURSOR else
    "000001"& cur_inc & cur_noshift when state = SETMODE else
    "00001" & open_display &open_cur & blank_cur when state =SWITCHMODE else
    "0001" & shift_display &left_shift &"00" when state = SHIFT else
    "001" & datawidth8 & twoline &font5x10 & "00" when state=SETFUNCTION else
    "01000000" when state =SETCGRAM else
    "10000000" when state =SETDDRAM and counter =0 else
    "11000000" when state =SETDDRAM and counter /=0 else
    data_in when state = WRITERAM else
    "ZZZZZZZZ";


    char_addr <=conv_std_logic_vector( counter,6) when state =WRITERAM and counter<40 else
    conv_std_logic_vector( counter-41+8,6) when state= WRITERAM and counter>40 and counter<81-8 else
    conv_std_logic_vector( counter-81+8,6) when state= WRITERAM and counter>81-8 and counter<81 else
    "000000";



    process(clk_int,Reset)
    begin
    if(Reset='0')then
    state<=IDLE;
    counter<=0;
    flag<='0';
    div_counter<=0;
    elsif(clk_int'event and clk_int='1')then
    case state is
    when IDLE =>
    if(flag='0')then
    state<=SETFUNCTION;
    flag<='1';
    counter<=0;
    div_counter<=0;
    else
    if(div_counter<DIVSS )then
    div_counter<=div_counter +1;
    state<=IDLE;
    else
    div_counter<=0;
    state <=SHIFT;
    end if;
    end if;
    when CLEAR =>
    state<=SETMODE;
    when SETMODE =>
    state<=WRITERAM;
    when RETURNCURSOR =>
    state<=WRITERAM;
    when SWITCHMODE =>
    state<=CLEAR;
    when SHIFT =>
    state<=IDLE;
    when SETFUNCTION =>
    state<=SWITCHMODE;
    when SETCGRAM =>
    state<=IDLE;
    when SETDDRAM =>
    state<=WRITERAM;
    when READFLAG =>
    state<=IDLE;
    when WRITERAM =>
    if(counter =40)then
    state<=SETDDRAM;
    counter<=counter+1;
    elsif(counter/=40 and counter<81)then
    state<=WRITERAM;
    counter<=counter+1;
    else
    state<=SHIFT;
    end if;
    when READRAM =>
    state<=IDLE;
    when others =>
    state<=IDLE;
    end case;
    end if;
    end process;



    end Behavioral;




    دلیل: ادغام دو پست برای جلوگیری از اسپم

    این کد هم ادامه lcd هستبیشتر از این نماتونم کمک کنم چون تقریبا فراموش کردم


    [FONT=Yekan]library IEEE;[/FONT]
    use IEEE.STD_LOGIC_1164.ALL;
    use IEEE.STD_LOGIC_ARITH.ALL;


    entity char_ram is
    port( address : in std_logic_vector(5 downto 0) ;
    data : out std_logic_vector(7 downto 0)
    );
    end char_ram;


    architecture fun of char_ram is


    function char_to_integer ( indata :character) return integer is
    variable result : integer range 0 to 16#7F#;
    begin
    case indata is
    when ' ' => result := 32;
    when '!' => result := 33;
    when '"' => result := 34;
    when '#' => result := 35;
    when '$' => result := 36;
    when '%' => result := 37;
    when '&' => result := 38;
    when ''' => result := 39;
    when '(' => result := 40;
    when ')' => result := 41;
    when '*' => result := 42;
    when '+' => result := 43;
    when ',' => result := 44;
    when '-' => result := 45;
    when '.' => result := 46;
    when '/' => result := 47;
    when '0' => result := 48;
    when '1' => result := 49;
    when '2' => result := 50;
    when '3' => result := 51;
    when '4' => result := 52;
    when '5' => result := 53;
    when '6' => result := 54;
    when '7' => result := 55;
    when '8' => result := 56;
    when '9' => result := 57;
    when ':' => result := 58;
    when ';' => result := 59;
    when '<' => result := 60;
    when '=' => result := 61;
    when '>' => result := 62;
    when '?' => result := 63;
    when '@' => result := 64;
    when 'A' => result := 65;
    when 'B' => result := 66;
    when 'C' => result := 67;
    when 'D' => result := 68;
    when 'E' => result := 69;
    when 'F' => result := 70;
    when 'G' => result := 71;
    when 'H' => result := 72;
    when 'I' => result := 73;
    when 'J' => result := 74;
    when 'K' => result := 75;
    when 'L' => result := 76;
    when 'M' => result := 77;
    when 'N' => result := 78;
    when 'O' => result := 79;
    when 'P' => result := 80;
    when 'Q' => result := 81;
    when 'R' => result := 82;
    when 'S' => result := 83;
    when 'T' => result := 84;
    when 'U' => result := 85;
    when 'V' => result := 86;
    when 'W' => result := 87;
    when 'X' => result := 88;
    when 'Y' => result := 89;
    when 'Z' => result := 90;
    when '[' => result := 91;
    when '\' => result := 92;
    when ']' => result := 93;
    when '^' => result := 94;
    when '_' => result := 95;
    when '`' => result := 96;
    when 'a' => result := 97;
    when 'b' => result := 98;
    when 'c' => result := 99;
    when 'd' => result := 100;
    when 'e' => result := 101;
    when 'f' => result := 102;
    when 'g' => result := 103;
    when 'h' => result := 104;
    when 'i' => result := 105;
    when 'j' => result := 106;
    when 'k' => result := 107;
    when 'l' => result := 108;
    when 'm' => result := 109;
    when 'n' => result := 110;
    when 'o' => result := 111;
    when 'p' => result := 112;
    when 'q' => result := 113;
    when 'r' => result := 114;
    when 's' => result := 115;
    when 't' => result := 116;
    when 'u' => result := 117;
    when 'v' => result := 118;
    when 'w' => result := 119;
    when 'x' => result := 120;
    when 'y' => result := 121;
    when 'z' => result := 122;
    when '{' => result := 123;
    when '|' => result := 124;
    when '}' => result := 125;
    when '~' => result := 126;
    when others => result :=32;
    end case;
    return result;
    end function;


    begin
    process (address)
    begin
    case address is
    when "000000" =>data<=conv_std_logic_vector(char_to_integer ('W') ,8);
    when "000001" =>data<=conv_std_logic_vector(char_to_integer ('W') ,8);
    when "000010" =>data<=conv_std_logic_vector(char_to_integer ('W') ,8);
    when "000011" =>data<=conv_std_logic_vector(char_to_integer ('.') ,8);
    when "000100" =>data<=conv_std_logic_vector(char_to_integer ('E') ,8);
    when "000101" =>data<=conv_std_logic_vector(char_to_integer ('C') ,8);
    when "000110" =>data<=conv_std_logic_vector(char_to_integer ('A') ,8);
    when "000111" =>data<=conv_std_logic_vector(char_to_integer ('.') ,8);
    when "001000" =>data<=conv_std_logic_vector(char_to_integer ('I') ,8);
    when "001001" =>data<=conv_std_logic_vector(char_to_integer ('R') ,8);
    when "010110" =>data<=conv_std_logic_vector(char_to_integer ('!') ,8);
    when "010111" =>data<=conv_std_logic_vector(char_to_integer ('!') ,8);
    when others =>data<=conv_std_logic_vector(char_to_integer ('!') ,8);
    end case;
    end process;
    end fun;


    جدیدترین ویرایش توسط sepehr63; ۰۹:۱۹ ۱۳۹۶/۰۹/۱۶.

    دیدگاه


      #3
      پاسخ : کار با برد fpga spartan-6 موجود در فروشگاه

      سلام
      خیلی ممنون مهندس سپر عزیز


      دلیل: ادغام دو پست برای جلوگیری از اسپم

      دوستان به یه مشکل برخوردم !!!!!!!!!!!
      برد رو نرم افزار ise نمیشناسه !!!!
      کسی هست کمکم کنه ؟
      اخطار زیر رو میده ! تا الان دو بار ویندوز عوض کردم و سه تا نرم افزار ise با ورژن های مختلف رو تست کردم . نشد که نشد
      این خطا رو میده!!
      can not find cable, check cable setup
      کسی هست کمک کنه مشکل ام برطرف بشه ؟ وینودوز 7 دارم 64 بیتی

      دیدگاه


        #4
        پاسخ : کار با برد fpga spartan-6 موجود در فروشگاه

        این برد نیاز به پروگرامر داره

        دیدگاه


          #5
          پاسخ : کار با برد fpga spartan-6 موجود در فروشگاه

          با سلام و ممنون از دوستان بابت سوالاتشون و راهنمایی هاشون. منم همین بورد را از فروشگاه سایت خریدم. سوالی که داشتم اینه یک سری فایل داخل سی دی به همراه بورد ارسال شد. از جمله برنامه های نمونه نیز در چند فولدر نیز وجود داشت. متاسفانه برنامه های نمونه را که تست کردم کار نکرد. می خواستم بپرسم آیا این برنامه ها توسط فروشگاه تست شده اند؟ اگر کار میکنند آیا نکته ای دارند که باید رعایت کرد؟ یه سری تنظیمات اصلی مثل تعریف پایه ها و پکیجینگ را به برنامه دادم اما کار نکرد.
          متشکر

          دیدگاه


            #6
            پاسخ : کار با برد fpga spartan-6 موجود در فروشگاه

            سلام
            درباره این برد میخواستم بدونم فایل پیکره بندی (UCF) کامل همراهش موجود هست؟ از دوستانی که این برد رو دارن سوال دارم که آیا بخرم؟ تعداد پایه های آزادش برای استفاده کاربر ، دو تا 34تایی هست؟

            دیدگاه

            لطفا صبر کنید...
            X