code VHDL à propos le VGA sur la carte Spartan-3
Répondre à la discussion
Affichage des résultats 1 à 25 sur 25

code VHDL à propos le VGA sur la carte Spartan-3



  1. #1
    invite8c6f844d

    code VHDL à propos le VGA sur la carte Spartan-3


    ------

    bonjour à tous

    je suis débutante à la programmation en VHDL. actuellement je travaille sur la carte Spartan-3. j'ai trouvé cet exemple de code sur le net:

    http://www.derepas.com/fabrice/hard/

    Pour l'exemple de "squares" , j'ai pas compris cette partie:

    " process (clk25)
    begin
    if clk25'event and clk25 = '1' then
    if (horizontal_counter >= "0010010000" ) -- 144
    and (horizontal_counter < "1100010000" ) -- 784
    and (vertical_counter >= "0000100111" ) -- 39
    and (vertical_counter < "1000000111" ) -- 519
    then
    red_out <= horizontal_counter(3)
    and vertical_counter(3);
    green_out <= horizontal_counter(4)
    and vertical_counter(4);
    blue_out <= horizontal_counter(5)
    and vertical_counter(5);
    else
    red_out <= '0';
    green_out <= '0';
    blue_out <= '0';
    end if;
    if (horizontal_counter > "0000000000" )
    and (horizontal_counter < "0001100001" ) -- 96+1
    then
    hs_out <= '0';
    else
    hs_out <= '1';
    end if;
    if (vertical_counter > "0000000000" )
    and (vertical_counter < "0000000011" ) -- 2+1
    then
    vs_out <= '0';
    else
    vs_out <= '1';
    end if;
    horizontal_counter <= horizontal_counter+"0000000001 ";
    if (horizontal_counter="110010000 0") then
    vertical_counter <= vertical_counter+"0000000001";
    horizontal_counter <= "0000000000";
    end if;
    if (vertical_counter="1000001001" ) then
    vertical_counter <= "0000000000";
    end if;
    end if;
    end process; "

    ou plus précisément, j'ai pas compris l'utilité de " horizontal-counter" et "vertical_counter".

    je me demande si quelqu'un peut m'expliquer ce code.

    Merci d'avance

    -----

  2. #2
    invite19f369ec

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    nombre de ligne et nombre de pixel par ligne?

  3. #3
    jiherve

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    bonsoir,
    j'avais zappé la question à l'époque c'est du code pourri, l'exemple type de ce qu'il ne faut pas écrire!
    Mais c'est bien du VGA 640x480.

    JR
    l'électronique c'est pas du vaudou!

  4. #4
    invite8848243a

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    Moi aussi je serai interéssé des différents opinion sur le controle du port VGA du spartan3... des tuto de code, ou bien des IP permettant d'apréhender ce port...

    Du code ke je vois la, il utilise donc " horizontal-counter" et "vertical_counter" pour faire les synchros video. Ce sont donc des compteur qui s'incrémententent a chaque evenement du clk25 (front montant)...format VGA (640x480)
    Si 0<H_sync< 97 alors à l'état bas, Sinon a l'état haut --> c'est la pulsation de synchro générale...H_sync se remet à zero apres 800 cp d'horloge Donc ta pulsation générale dure 32µs à 25Mhz. C'est en fait Une ligne vidéo qui vien de se dérouler. A chaque fois que H_sync passe à zéro, V_sync s'incrément, on change de ligne...
    Dans ta pulsation générale, il y à un laps de temps permettant l'affichage à l'écrant d'une durée de 25µs soit 640 cp d'horloges....C'est a dire que tu peut commencer l'affichage à partir de H_sycn = 48 (temps permettant le déplacement du beam je pense) et V_sync = 29, C'est le minimum. (Norme)...

    Dans le code, il a choisi de faire de faire un patern (je crois ke ca s'appel comme cela) ou un carré coloré sur ton ecran. Les couleurs de chaque pixels devraient changer en fonction des position puiqsu'il s'inspire des bit n° 3 des compteurs ( red_out <= horizontal_counter(3) and vertical_counter(3) ) comme valeur de sortie pour la sortie RGB (codé sur trois bits....a savoir que si R = 0, G = 0 et B = 0 donnerons du noir a l'écran...R = 0, G = 1, et B = 0 donnera du verts...)

    Voila comment j'ai compris le code...
    JE serai ravi de découvrir d'avantage le spartan donc si vous avez de bon sites a me conseiller....
    Merci et bon courage

  5. A voir en vidéo sur Futura
  6. #5
    invite8c6f844d

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    bonsoir Mich35, jiherve, bonsoir à tous,
    j'ai eu des problèmes au début à comprendre cet exemple mais bon aprés que j'ai lu et je relu j'ai bien compris ce code
    mais manitenent, j'ai un probléme à afficher un carcatère sur l'écran.
    j'ai trouvé cette méthode qui consiste à afficher un caractère 8*8 pixels comme le cas par exemple pour la lettre A :
    00011000
    00111100
    01100110
    01111110
    01100110
    01100110
    01100110
    00000000
    avec les 1 sont les pixels allumés.
    et j'ai mis ces bits dans un vecteur
    tabA:"000110000011110001100110 011111100110011001100110011001 1000000000";
    voila le code :

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


    entity caracTest is
    Port ( clk50 : in std_logic;
    red: out std_logic;
    green : out std_logic;
    blue: out std_logic;
    hs : out std_logic;
    vs : out std_logic);
    end caracTest;

    architecture Behavioral of caracTest is
    signal clk25 : std_logic;
    signal hcounter : integer range 0 to 800;
    signal vcounter : integer range 0 to 521;

    begin

    ----- génération de l'horloge 25Mhz
    process (clk50)

    begin
    if clk50'event and clk50='1' then
    clk25 <= not clk25 ;
    end if;

    end process;
    -------------------------------------
    -------------------------------------

    p2: process (clk25, hcounter, vcounter)
    -- matrice 8*8 du caractére A ,les 1 presentent les pixels allumés alors que les 0 les pixels eteints
    variable TabA :bit_vector (63 downto 0):= "00011000001111000110011001111 110011001100110011001100110000 00000";
    variable i : integer range 0 to 64; -- un compteur
    --type Compteur is array (1 to 8) of integer;
    --variable cpt: compteur:=(1=>8, 2=>16, 3=>24, 4=>32, 5=>40, 6=>48, 7=>56, 8=>64);

    begin
    if clk25'event and clk25 = '1' then
    if (hcounter >= 144 ) and (hcounter < 784 ) and (vcounter >= 39 )and (vcounter < 519 ) then -- préciser les pixels visibles
    if (hcounter <153 and vcounter < 48) then -- la lettre A doit etre affiché sur 8 pixels
    if ( TabA(i)='1') then
    red <= '1';
    green <='1';
    blue <= '1';
    elsif TabA(i)='0' then
    red <= '0';
    green <= '0';
    blue <= '0';
    end if;
    i:= i+1;

    elsif (hcounter >=153 or vcounter >= 48) then
    red <= '0';
    green <= '0';
    blue <= '0';

    end if ;


    end if ;

    if (hcounter > 0 ) and (hcounter < 97 ) then -- se sont des pixels invisibles au moment de la synchronisation
    hs <= '0';
    else
    hs <= '1';
    end if;

    if (vcounter > 0 ) and (vcounter < 3 ) then -- des lignes invisibles le moment de la synchro
    vs <= '0';
    else
    vs <= '1';
    end if;


    --- compteur du nbre de pixels horizontales de 0 à 800
    hcounter <= hcounter+1;

    -- compter le nbr de lignes
    if hcounter = 800 then
    vcounter <= vcounter+1;
    hcounter <= 0;
    end if;
    -- compteur vertical pour compter le nbre de ligne de 0 à 521
    if vcounter = 521 then
    vcounter <= 0;
    end if;
    end if;
    end process p2;
    end Behavioral;

    le probleme c que les 8*8pixels affichent une imege instable, et j'ai pas arrivé à savoir le probléme

    merci d'avance.

  7. #6
    invite8c6f844d

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    Bonsoir blacklion45,
    merci bien pour l'explication.
    moi aussi je suis trés intéressée de tout ce qui concerne le Spartan-3 et l'affichage via le port VGA.

    A propos la documentation,( et si tu n'as pas des problèmes avec la langue anglaise )j'ai trouvé ce guide sur la carte Spartan-3:
    lark.tu-sofia.bg/asic/labs/s3demo/Digilent_S3.pdf

    je ne sais pas si cela t'intéresse ou pas..

  8. #7
    inviteb2836cff

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    slt radiotique est ce que tu peux m'aider pour afficher un caractère sur l'écran vga via spartan 3e en vhdl merci

  9. #8
    invite8c6f844d

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    Bonjour nassim83,

    je vais te donner ce code présenté ci-dessous:

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


    entity VGA_Module is
    Port ( clk50_in : in std_logic;
    Red_out : out std_logic;
    Green_out : out std_logic;
    Blue_out : out std_logic;
    hs_out : out std_logic;
    vs_out : out std_logic);
    end VGA_Module;

    architecture Behavioral of VGA_Module is
    signal Clk25 : std_logic;
    signal Horizontal_Counter : std_logic_vector (9 downto 0);
    signal Vertical_Counter : std_logic_vector (9 downto 0);

    begin
    --Generate 25Mhz Clock--
    process (clk50_in)
    begin
    if clk50_in'event and clk50_in='1' then
    if (Clk25 = '0')then
    Clk25 <= '1' after 2 ns;
    else
    Clk25 <= '0' after 2 ns;
    end if;
    end if;
    end process;



    process (Clk25)

    TYPE Screen_Line1 is ARRAY(0 to 19, 0 to 69) OF std_logic;


    CONSTANT char_L1 : Screen_Line1 :=(
    ('0','0','0','1','1','1','1',' 1','1','1','1','0','0','0','0' ,'0','0','1','1','1','1','0',' 0','0','0','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','0', '0','0','0','1','1','1','1','0 ','0','0','0','0','0',
    '0','0','1','0','0','0','0','0 ','0','0','0','0','1','0','0') ,
    ('0','0','1','1','1','1','1',' 1','1','1','1','0','0','0','0' ,'0','1','1','1','1','1','1',' 0','0','0','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','0', '0','0','1','1','1','1','1','1 ','0','0','0','0','0',
    '0','1','1','1','0','0','0','0 ','0','0','0','1','1','1','0') ,
    ('0','1','1','1','1','1','1',' 1','1','1','1','0','0','0','0' ,'1','1','1','1','1','1','1',' 1','0','0','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','0', '0','1','1','1','1','1','1','1 ','1','0','0','0','0',
    '0','1','1','1','1','0','0','0 ','0','0','1','1','1','1','0') ,
    ('0','1','1','1','1','0','0',' 0','0','0','0','0','0','0','1' ,'1','1','1','0','0','1','1',' 1','1','0','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','0', '1','1','1','1','0','0','1','1 ','1','1','0','0','0',
    '0','1','1','1','1','1','0','0 ','0','1','1','1','1','1','0') ,
    ('0','1','1','1','1','0','0',' 0','0','0','0','0','0','1','1' ,'1','1','0','0','0','0','1',' 1','1','1','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','1', '1','1','1','0','0','0','0','1 ','1','1','1','0','0',
    '0','1','1','1','1','1','1','0 ','1','1','1','1','1','1','0') ,
    ('0','1','1','1','1','0','0',' 0','0','0','0','0','0','1','1' ,'1','1','0','0','0','0','1',' 1','1','1','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','1', '1','1','1','0','0','0','0','1 ','1','1','1','0','0',
    '0','1','1','1','1','1','1','1 ','1','1','1','1','1','1','0') ,
    ('0','0','1','1','1','1','0',' 0','0','0','0','0','0','1','1' ,'1','1','0','0','0','0','1',' 1','1','1','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','1', '1','1','1','0','0','0','0','1 ','1','1','1','0','0',
    '0','1','1','1','0','1','1','1 ','1','1','0','1','1','1','0') ,
    ('0','0','0','1','1','1','1',' 0','0','0','0','0','0','1','1' ,'1','1','0','0','0','0','1',' 1','1','1','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','1', '1','1','1','0','0','0','0','1 ','1','1','1','0','0',
    '0','1','1','1','0','0','1','1 ','1','0','0','1','1','1','0') ,
    ('0','0','0','0','1','1','1',' 1','0','0','0','0','0','1','1' ,'1','1','0','0','0','0','1',' 1','1','1','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','1', '1','1','1','0','0','0','0','1 ','1','1','1','0','0',
    '0','1','1','1','0','0','0','1 ','0','0','0','1','1','1','0') ,
    ('0','0','0','0','0','1','1',' 1','1','0','0','0','0','1','1' ,'1','1','1','1','1','1','1',' 1','1','1','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','1', '1','1','1','1','1','1','1','1 ','1','1','1','0','0',
    '0','1','1','1','0','0','0','0 ','0','0','0','1','1','1','0') ,
    ('0','0','0','0','0','0','1',' 1','1','1','0','0','0','1','1' ,'1','1','1','1','1','1','1',' 1','1','1','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','1', '1','1','1','1','1','1','1','1 ','1','1','1','0','0',
    '0','1','1','1','0','0','0','0 ','0','0','0','1','1','1','0') ,
    ('0','0','0','0','0','0','0',' 1','1','1','1','0','0','1','1' ,'1','1','1','1','1','1','1',' 1','1','1','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','1', '1','1','1','1','1','1','1','1 ','1','1','1','0','0',
    '0','1','1','1','0','0','0','0 ','0','0','0','1','1','1','0') ,
    ('0','0','0','0','0','0','0',' 1','1','1','1','0','0','1','1' ,'1','1','0','0','0','0','1',' 1','1','1','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','1', '1','1','1','0','0','0','0','1 ','1','1','1','0','0',
    '0','1','1','1','0','0','0','0 ','0','0','0','1','1','1','0') ,
    ('0','0','0','0','0','0','0',' 1','1','1','1','0','0','1','1' ,'1','1','0','0','0','0','1',' 1','1','1','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','0','0','0','0','1', '1','1','1','0','0','0','0','1 ','1','1','1','0','0',
    '0','1','1','1','0','0','0','0 ','0','0','0','1','1','1','0') ,
    ('0','0','0','0','0','0','0',' 1','1','1','1','0','0','1','1' ,'1','1','0','0','0','0','1',' 1','1','1','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','1','1','0','0','1', '1','1','1','0','0','0','0','1 ','1','1','1','0','0',
    '0','1','1','1','0','0','0','0 ','0','0','0','1','1','1','0') ,
    ('0','0','0','0','0','0','0',' 1','1','1','1','0','0','1','1' ,'1','1','0','0','0','0','1',' 1','1','1','0','0',
    '1','1','1','0','0','0','0','0 ','0','0','1','1','0','0','1', '1','1','1','0','0','0','0','1 ','1','1','1','0','0',
    '0','1','1','1','0','0','0','0 ','0','0','0','1','1','1','0') ,
    ('0','1','1','1','1','1','1',' 1','1','1','1','0','0','1','1' ,'1','1','0','0','0','0','1',' 1','1','1','0','0',
    '1','1','1','1','1','1','1','1 ','1','1','1','1','0','0','1', '1','1','1','0','0','0','0','1 ','1','1','1','0','0',
    '0','1','1','1','0','0','0','0 ','0','0','0','1','1','1','0') ,
    ('0','1','1','1','1','1','1',' 1','1','1','0','0','0','1','1' ,'1','1','0','0','0','0','1',' 1','1','1','0','0',
    '1','1','1','1','1','1','1','1 ','1','1','1','0','0','0','1', '1','1','1','0','0','0','0','1 ','1','1','1','0','0',
    '1','1','1','1','1','0','0','0 ','0','0','1','1','1','1','1') ,
    ('0','1','1','1','1','1','1',' 1','1','0','0','0','0' ,'1','1','1','1','0','0','0',' 0','1','1','1','1','0','0',
    '1','1','1','1','1','1','1','1 ','1','1','0','0','0','0','1', '1','1','1','0','0','0','0','1 ','1','1','1','0','0',
    '1','1','1','1','1','0','0','0 ','0','0','1','1','1','1','1') ,
    ('0','0','0','0','0','0','0',' 0','0','0','0','0','0','0','0' ,'0','0','0','0','0','0','0',' 0','0','0','0','0',
    '0','0','0','0','0','0','0','0 ','0','0','0','0','0','0','0', '0','0','0','0','0','0','0','0 ','0','0','0','0','0',
    '0','0','0','0','0','0','0','0 ','0','0','0','0','0','0','0') );--SALAM


    variable Line:integer:=0;
    variable Pixel:integer:=0;

    begin --initial the screen
    if Clk25'event and Clk25 = '1' then
    if (Horizontal_Counter >= "0010010000" ) -- 144 why from 144?
    and (Horizontal_Counter < "1100010000" ) -- 784 640+100
    and (Vertical_Counter >= "0000100111" ) -- 39 why from 39?
    and (Vertical_Counter < "1000000111" ) -- 519 480+39
    then
    Red_out <= '0';
    Green_out <= '0';
    Blue_out <='0';
    -----Line 1
    if (Horizontal_Counter >= "0110010000" )--400
    and (Horizontal_Counter <= "0111010110")-- 470 640/2+24+144
    and (Vertical_Counter >= "0011101000") --232
    and (Vertical_Counter <= "011111100") then --252
    if(Pixel <= 69) then --Line 1 Lets make our Text WHITE
    Red_out <= char_L1(Line, Pixel);
    Green_out <='0';-- char_L1(Line, Pixel);
    Blue_out <= char_L1(Line, Pixel);
    Pixel:= Pixel+1;
    elsif(Pixel >= 70) then -- All else BLACK
    Red_out <= '0';
    Green_out <= '0';
    Blue_out <= '0';
    end if;
    end if;
    end if;
    if (Horizontal_Counter > "0000000000" )
    and (Horizontal_Counter < "0001100001" ) -- 96+1 generate the hs_out and the vs_out
    then
    hs_out <= '0';
    else
    hs_out <= '1';
    end if;
    if (Vertical_Counter > "0000000000" )
    and (Vertical_Counter < "0000000011" ) -- 2+1
    then
    vs_out <= '0';
    else
    vs_out <= '1';
    end if;

    Horizontal_Counter <= Horizontal_Counter+"0000000001 ";
    if (Horizontal_Counter="110010000 0") then --800? decide the frequency of Hs 50000000/2/800 = 31.25K Hz
    Vertical_Counter <= Vertical_Counter+"0000000001";
    Horizontal_Counter <= "0000000000";
    Pixel:= 0;
    if (Vertical_Counter >= "0011101000") -- First Line 232
    and (Vertical_Counter <= "011111100") then --252
    if (Line <= 19) then
    Line:= Line+1;
    elsif (Line >= 20) then
    Line:= 0;
    end if;
    end if;
    end if;
    if (Vertical_Counter="1000001001" ) then --521? decide the frequency of Hs 50000000/2/800/521 = 59.98 Hz
    Vertical_Counter <= "0000000000";
    Line:= 0;
    end if;
    end if;
    end process;
    end Behavioral;
    ------------------------------------------------------------------------------


    ce code affichera le mot "SALAM" en utilisant la carte SPARATN-3

  10. #9
    invite8c6f844d

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    Pour mieux expliquer, si tu a bien compris la synchronisation sur un écran VGA tu pourrais exploiter ce code et l'optimiser pour afficher les caractères de la façon suivante:

    TYPE Screen_Line1 is ARRAY(0 to 8, 0 to N) OF std_logic;
    --- tu devras bien choisir le N selon le nombre de caractère voulu




    CONSTANT char_L1 : Screen_Line1 :=(
    00011000 --- 11
    00111100 --- 1111
    01100110---- 11 11
    01111110 ---- 111111
    01100110 ---- 11 11
    01100110---- 11 11
    01100110---- 11 11
    00000000 ---- c'est la caractère A

    01111110
    11000011
    11000011
    11111110
    11000011
    11000011
    11000011
    01111110
    -- le caractère B



    et ainsi de suite c'est beaucoup plus pratique et plus clair

    alors que pour la méthode que précedente j'ai ecrit le mot sous forme de 0 et de 1 et puis je l'ai affiché ligne par ligne ce que n'ai pas pratique si tu voudras afficher un phrase un peu longue...
    j'espere que ce code ira te donner un peu avec un peu de recherche sur google tu trouveras la solution ))

    Bon courage et bonne continuation

  11. #10
    inviteb2836cff

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    merci merci merci ...beaucoup beaucoup..... radiotique vous êtes merveilleux
    merci demain nchallah je l'implanter sur la carte merci

  12. #11
    invite8c6f844d

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    Pas de quoi, pas de quoi, pas de quoi nassim83 au contraire c'est avec un grand plaisir car je sais bien votre situation (car j'ai passé des longues journées avant de trouver une solution... )
    j'ai voulu meme vous aider plus que ça , en effet j'ai implimenté un programme en utilisant la 2éme méthode que je vous indiquée ( car comme j'ai déja dit "c'est une méthode beaucoup plus perfermante" ) .... bon c'est une longue histoire... mais une panne à ma disque dur a permis de perdre tout
    bref, je vous souhaite une bonne continuation et que Dieu soit avec vous , et n'hesite pas à poser vos question, je vous repondrai Nchalah si j'aurai une réponse
    BONNE NUIT

  13. #12
    inviteb2836cff

    Smile Re : code VHDL à propos le VGA sur la carte Spartan-3

    merci radiotique si très gentil

  14. #13
    inviteb2836cff

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    slt radiotique j'ai essayer le programme SALAM il marche bien mais pour la 2 eme méthode j'ai pas compris bien, comment vous l'écrire dans le pgm est ce que je l'ecrire comme un vecteur ou un matrice
    merci et désoler

  15. #14
    invite8c6f844d

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    slt nassim83, félicitations alors pour la réussite de ta 1ere méthode ^_^
    Pour la 2éme methode, c'est sur sous la forme d'une matrice et je vais te donner quelques liens qui vont t'aider énormément (plutot je pense que vont t'aider énormément *-) ) :
    1er lien que je pense qu'il peut etre la réponse à ta question :
    http://vhdl33.free.fr/wp-content/fichiers/fonts.vhd

    essaie de voir ça de plus :
    http://uuu.enseirb-matmeca.fr/~nouel...affich_vga.pdf

    et ça :
    http://vhdl33.free.fr/index.php/comp...hiers-sources/

    bon courage et que Dieu soit avec toi

  16. #15
    inviteb2836cff

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    merci radiotique

  17. #16
    inviteb2836cff

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    merci radiotique ,malheureusement le 1 lien marche pas mais j t merci pour tous merci beaucoup

  18. #17
    invite8c6f844d

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    re-essai de cliquer sur le le premier lien , il fonctionne normalement... et il va t'aider..
    si'il n'a pas fonctionné alor je te guide pour l'ouvrir autrement: tu clique sur le 3éme lien, tu trouve le titre "Traitement image" sous le sous-titre "utilitaire" tu trouve ce fichier :fonts.vhd # — Caracteres 8×8 pixels .... et yop tu trouveras le fichier du 1er lien

    bonne nuitttttttttttttt

  19. #18
    inviteb2836cff

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    merci beaucoup pour ton aide
    c tres gentil le premier lien a marché

  20. #19
    inviteb2836cff

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    slt radiotique tu va bien , pour le 2 eme prgm c pour sauvegarder les caractères dans une mémoire Rom je pense , est ce que je peux faire la combinaison entre les 2 pgm pour l'affichage, et pour le 2 eme prgm je vienne pas a localiser(location) les entres et les sortie (adresse , line font , pixels ...) sur la carte par exemple (VGA_RED est (H14) ,VGA_GREEN est (H15),VGA_HSYNC est (F15).......) ,et mon bute est de sauvegarder les caractères dans une memoire apres les afficher sur l'écran merci radiotique et désoler pour ces questions

  21. #20
    invite8c6f844d

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    slt nassim83,
    bien sur tu peux faire la combinaison entre les deux programme, et si tu n'arrive pas à localiser les entrés et les sorties essais toi meme de créer tes entrées et tes sorties, en effet je t'ai donné ce programme c'est juste pour avoir une idée comment pourras tu stocker les differentes caractéres.
    A propos la sauvgarde, je te propose d'utiliser une matrice pour stocker les differentes caractéres aprés l'affichage (bon je sais pas si ma réponse t'a plu ou pas , j'espere que j'ai arrivé à t'aider meme un tout petit peu )

    bonne continuation

  22. #21
    inviteb2836cff

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    merci beaucoup radiotique bonne nuit

  23. #22
    inviteb2836cff

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    slt radiotique tu va bien, désoler j'ai trouver un programme sue le net et je n'ai pas compris le bien voila le pgm
    Display on VGA without SDRAM
    The problem: I want to display dynamic characters on the screen. The normal work is
    to use a SDRAM to save the contents of the VGA matrix. If I will use 680 * 460 so I
    have to use matrix 680*460 of 3 bytes for the red and green and blue.
    But I will make it simple and will use 2 colors so I just need 1 bit. So I can design a
    matrix using VHDL which will be 680*640. Oh, there is another problem. It takes too
    much time to synthesize the code because every bit is connected as a signal.
    How can I solve this??
    I had a nice idea. I will show the char in 10*10 bit. So the 680*460 matrix can be only 86*46. it will take no time in systemization. I considered the 86*46 matrix as a
    pointer which point at the small matrices.
    Why did I do that?
    I wanted to make a complete system which contain (keyboard, VGA, UART, GPIO, LCD and soft-processor). I have already design the rest of the system but I want to make it completely.
    Well, I don't like to talk much. Just look at the code. It is for Spartan 3E for simplification.
    You may notice some weird things. For example I wanted to divide an integer by 10 but this is a problem in VHDL. So I did it using
    for loop. By make a counter that count by 10 and notice the equalization.
    Anyway, this is the code. It is not the final code but you will see some alphabets in some places in the screen. You just have to get an input from outside to write on the screen wherever you want.
    entity vga is
    Port ( CLK50_in : in STD_LOGIC;
    HS : out STD_LOGIC;
    VS : out STD_LOGIC;
    r,g,b : out std_logic
    );
    end vga;
    architecture Behavioral of vga is
    ------- signals declarations
    signal clk25: std_logic;
    signal H_counter_value : integer;--std_logic_vector(9 downto 0);
    signal V_counter_value : integer;--std_logic_vector(9 downto 0);
    signal x : integer range 0 to 640; --std_logic_vector(9 downto 0);
    signal y : integer range 0 to 640; -- std_logic_vector(9 downto 0);
    signal c:std_logic_vector(7 downto 0);
    signal xx,yy :integer;
    shared variable xd,yd:integer;
    signal data:std_logic_vector(0 to 9);
    --constant c_x_l : integer := 320 ;
    --constant c_x_r: integer := 327;
    --constant c_y_u : integer := 150 ;
    --constant c_y_d: integer := 157 ;
    --signal gdata: std_logic_vector(7 downto 0):="11110000";
    signal obj_rgb:std_logic_vector(2 downto 0) := "001";
    --signal obj2_rgb:std_logic_vector(2 downto 0) := "010";
    --signal ball_rgb:std_logic_vector(2 downto 0) := "011";
    --signal a_on,b_on,c_on:std_logic;
    --signal tick:std_logic;
    --signal counter2:integer:=0;
    --subtype tmp is integer;
    type memory_array is array ( 0 to 9 ) of std_logic_vector (0 to 9 ) ;
    subtype tmp is std_logic_vector( 7 downto 0);
    type memory is array(integer range 0 to 64,integer range 0 to 48) of tmp;
    signal mem:memory;
    constant am : memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110000110", --
    "0110000110" , --
    "0111111110", --
    "0111111110", --
    "0110000110", --
    "0110000110", --
    "0000000000"
    );
    constant bm : memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110000110", --
    "0110000110" , --
    "0111111100", --
    "0110000110", --
    "0110000110", --
    "0111111110",--
    "0000000000"
    );
    constant cm: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110000000", --
    "0110000000" , --
    "0110000000", --
    "0110000000", --
    "0111111110", --
    "0111111110", --
    "0000000000"
    );
    constant dm: memory_array:= (
    "0000000000",
    "0111111100", --
    "0111111110" , --
    "0110000110", --
    "0110000110" , --
    "0110000110", --
    "0110000110", --
    "0111111110", --
    "0111111100", --
    "0000000000"
    );
    constant em: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110000000", --
    "0111111110" , --
    "0111111110", --
    "0110000000", --
    "0111111110", --
    "0111111110", --
    "0000000000"
    );
    constant fm: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110000000", --
    "0110000000" , --
    "0111111110", --
    "0111111110", --
    "0110000000", --
    "0110000000", --
    "0000000000"
    );
    constant gm: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110000000", --
    "0110000000" , --
    "0110011110", --
    "0110011110", --
    "0111111110", --
    "0111111110", --
    "0000000000"
    );
    constant hm: memory_array:= (
    "0000000000",
    "0110000110", --
    "0110000110" , --
    "0110000110", --
    "0111111110" , --
    "0111111110", --
    "0110000110", --
    "0110000110", --
    "0110000110", --
    "0000000000"
    );
    constant im: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110000000", --
    "0110000000" , --
    "0110000000", --
    "0110000000", --
    "0111111110", --
    "0111111110", --
    "0000000000"
    );
    constant jm: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110110000", --
    "0110110000" , --
    "0110110000", --
    "0000110000", --
    "0111111110", --
    "0111111110", --
    "0000000000"
    );
    constant km: memory_array:= (
    "0000000000",
    "0110000110", --
    "0110001100" , --
    "0110011000", --
    "0110110000" , --
    "0111100000", --
    "0110011000", --
    "0110001100", --
    "0110000110", --
    "0000000000"
    );
    constant lm: memory_array:= (
    "0000000000",
    "0110000000", --
    "0110000000" , --
    "0110000000", --
    "0110000000" , --
    "0110000000", --
    "0110000000", --
    "0111111110", --
    "0111111110", --
    "0000000000"
    );
    constant mm: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110110110", --
    "0110110110" , --
    "0110110110", --
    "0110110110", --
    "0110110110", --
    "0110110110", --
    "0000000000"
    );
    constant nm: memory_array:= (
    "0000000000",
    "0111000110", --
    "0111000110" , --
    "0110110110", --
    "0110110110" , --
    "0110110110", --
    "0110011110", --
    "0110001110", --
    "0110001110", --
    "0000000000"
    );
    constant om: memory_array:= (
    "0000000000",
    "0011111100", --
    "0111111110" , --
    "0110000110", --
    "0110000110" , --
    "0110000110", --
    "0110000110", --
    "0111111110", --
    "0011111100", --
    "0000000000"
    );
    constant pm: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110000110", --
    "0111111110" , --
    "0111111110", --
    "0110000000", --
    "0110000000", --
    "0110000000", --
    "0000000000"
    );
    constant qm: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110000110", --
    "0110000110" , --
    "0110000110", --
    "0110110110", --
    "0101111010", --
    "0001111000", --
    "0000000000"
    );
    constant rm: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110000110", --
    "0110000110" , --
    "0111111110", --
    "0110110000", --
    "0110001100", --
    "0110000110", --
    "0000000000"
    );
    constant sm: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0110000000", --
    "0111111100" , --
    "0011111110", --
    "0000000110", --
    "0111111110", --
    "0111111110", --
    "0000000000"
    );
    constant tm: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0000110000", --
    "0000110000" , --
    "0000110000", --
    "0000110000", --
    "0000110000", --
    "0000110000", --
    "0000000000"
    );
    constant um: memory_array:= (
    "0000000000",
    "0110000110", --
    "0110000110" , --
    "0110000110", --
    "0110000110" , --
    "0110000110", --
    "0110000110", --
    "0111111110", --
    "0111111110", --
    "0000000000"
    );
    constant vm: memory_array:= (
    "0000000000",
    "0110000110", --
    "0110000110" , --
    "0110000110", --
    "0011001100" , --
    "0011001100", --
    "0001101100", --
    "0001111000", --
    "0000110000", --
    "0000000000"
    );
    constant wm: memory_array:= (
    "0000000000",
    "0110110110", --
    "0110110110" , --
    "0110110110", --
    "0110110110" , --
    "0110110110", --
    "0110110110", --
    "0111111110", --
    "0111111110", --
    "0000000000"
    );
    constant xm: memory_array:= (
    "0000000000",
    "0110000110", --
    "0110000110" , --
    "0011001100", --
    "0001111000" , --
    "0001111000", --
    "0011001100", --
    "0110001110", --
    "0110000110", --
    "0000000000"
    );
    constant ym: memory_array:= (
    "0000000000",
    "0110000110", --
    "0110000110" , --
    "0011001100", --
    "0001111000" , --
    "0000110000", --
    "0000110000", --
    "0000110000", --
    "0000110000", --
    "0000000000"
    );
    constant zm: memory_array:= (
    "0000000000",
    "0111111110", --
    "0111111110" , --
    "0000011100", --
    "0000111000" , --
    "0001110000", --
    "0011100000", --
    "0111111110", --
    "0111111110", --
    "0000000000"
    );
    constant spa: memory_array:= (
    "0000000000",
    "0000000000", --
    "0000000000", --
    "0000000000",--
    "0000000000", --
    "0000000000",--
    "0000000000",--
    "0000000000",--
    "0000000000", --
    "0000000000"
    );
    begin
    --a_on <=
    --'1' when (a_x_l <= x ) and (x <= a_x_r) and (a_y_u <=y) and (a_y_d >= y) else
    --'0';
    --b_on <=
    --'1' when (b_x_l <= x ) and (x <= b_x_r) and (b_y_u <=y) and (b_y_d >= y) else
    --'0';
    --c_on <=
    --'1' when (c_x_l <= x ) and (x <= c_x_r) and (c_y_u <=y) and (c_y_d >= y) else
    --'0';
    -- generate a 25Mhz clock
    divide_by_two_counter rocess (clk50_in)
    begin
    if clk50_in'event and clk50_in='1' then
    clk25 <= not clk25;
    end if;
    end process;
    -- generate the tick for the refreshment of the object position
    --counter rocess (clk50_in)
    -- begin
    -- if clk50_in'event and clk50_in='1' then
    --counter2<=counter2 + 1;
    --tick<='0';
    --end if;
    --if counter2<=50000000 then
    --counter2<=0;
    --tick<='1';
    --end if;
    --end process;
    --process(clk50_in,tick)
    --begin
    --if tick='1' then
    --ball_x_r <= ball_x_r + 1;
    --ball_x_l <= ball_x_l + 1;
    --end if;
    --if ball_x_r = 510 then
    --ball_x_r <=100;
    --ball_x_l <=107;
    --end if;
    --end process;
    HS_VS_generator rocess (clk25)
    begin
    if clk25'event and clk25='1' then
    H_counter_value <= H_counter_value +1;
    if (H_counter_value = 800)then
    H_counter_value <= 0;
    V_counter_value <= V_counter_value +1;
    end if;
    if (V_counter_value = 521)then
    V_counter_value <= 0;
    end if;
    x <= H_counter_value-144;
    y <= V_counter_value-31;
    --if (H_counter_value >=144 and H_counter_value < 783 and V_counter_value >=31
    and V_counter_value <510) then
    -- if((x>=0)and(x<256)and(y>=0)an d(y<256))then
    -- addr<=addr+1;
    -- ena<='1';
    -- r<='0';b<='0';--g<=(others=>'0');
    -- g<='1';
    --else
    -- r<='1';b<='0';g<='0';addr<="00 00000000000000";
    -- ena<='0';
    -- end if;
    --else
    -- r<='0';g<='0';b<='0';addr<="00 00000000000000";
    --reed<='0';ena<='0';
    --end if;
    if (H_counter_value < 96)then
    HS <= '0';
    else
    HS <= '1';
    end if;
    if (V_counter_value < 2)then
    VS <= '0';
    else
    VS <= '1';
    end if;
    end if;
    end process;
    -------process(clk25,a_on,b_on,c_on)
    --variable x_object,y_object :integer;
    --variable d:std_logic;
    --variable mem:memory_array;
    --begin
    --if clk25'event and clk25='0' then
    --if a_on ='1' then
    --x_object:= x - a_x_l ;
    --y_object:= y - a_y_u ;
    --data :=mem1(y_object);
    --c<= data (x_object);
    --mem(x)(y) <= mem1(x_object)(y_object);
    --elsif b_on ='1' then
    --x_object:= x - b_x_l;
    --y_object:= y - b_y_u;
    --data :=mem2(y_object);
    --c<= data (x_object);
    --mem(x)(y) <= mem2(x_object)(y_object);
    --elsif c_on='1' then
    --x_object:= x - c_x_l;
    --y_object:= y - c_y_u;
    --mem(x)(y) <= mem3(x_object)(y_object);
    --data :=mem3(y_object);
    --c<= data (x_object);
    --end if;
    --end if;
    --end process;
    mem(0,0)<= "00000001";
    mem(1,0)<= "00000010";
    mem(0,3)<= "00000011";
    mem(10,10)<= "00001100";
    mem(11,25)<= "00010110";
    mem(0,30)<= "00001011";
    process(clk25,x,y)
    variable v,u:integer;
    begin
    if clk25'event and clk25='1' then
    for n in 0 to 64 loop
    v:= n * 10;
    if v=x then
    xd:=n;
    end if;
    end loop;
    for t in 0 to 64 loop
    u:= t * 10;
    if u=y then
    yd:=t;
    end if;
    end loop;
    c<= mem (xd,yd);
    xx<= x - 10* xd;
    yy<=y - 10*yd;
    end if;
    end process;
    with c select
    data<= am(yy) when "00000001",
    bm(yy) when "00000010",
    cm(yy) when "00000011",
    dm(yy) when "00000100",
    em(yy) when "00000101",
    fm(yy) when "00000110",
    gm(yy) when "00000111",
    hm(yy) when "00001000",
    im(yy) when "00001001",
    jm(yy) when "00001010",
    km(yy) when "00001011",
    lm(yy) when "00001100",
    mm(yy) when "00001101",
    nm(yy) when "00001110",
    om(yy) when "00001111",
    pm(yy) when "00010000",
    qm(yy) when "00010001",
    rm(yy) when "00010010",
    sm(yy) when "00010011",
    tm(yy) when "00010100",
    um(yy) when "00010101",
    vm(yy) when "00010110",
    wm(yy) when "00010111",
    xm(yy) when "00011000",
    ym(yy) when "00011001",
    zm(yy) when "00011010",
    spa(yy) when others;
    process(clk25,H_counter_value, V_counter_value,c)
    begin
    if (H_counter_value >=144 and H_counter_value < 783 and V_counter_value >=31
    and V_counter_value <510) then
    r<='0';
    b<=data(xx);
    g<='0';
    end if;
    end process;
    end Behavioral;

  24. #23
    inviteb2836cff

    Re : microblaze

    slt radiotique sa va , est ce que avez vous un document en francais sur microblaze merci (anoeln@live.fr)

  25. #24
    invite5d9e9987

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    salam bonjour
    je suis un etudiant en microélectronique et j'ai commencer a me former sur la carte xilinx spartan3
    est ce quelqu'un peut me donner ou m'expliquer commer :
    1- implementer ou compiler une application sur la carte
    2- creer un nouvel IP et le tester
    merci d'avance

  26. #25
    invite35f2a728

    Re : code VHDL à propos le VGA sur la carte Spartan-3

    Bonjour,
    merci pour les explications, cela m'a beaucoup aidé.
    J'ai une petit question, comment avez vous fait pour générer les matrice des caractères?
    merci.

Discussions similaires

  1. Connection d'une carte Spartan 3E avec un Sonar
    Par invitebcede47f dans le forum Électronique
    Réponses: 2
    Dernier message: 30/01/2011, 06h07
  2. programmation VHDL du VGA
    Par invited6661c5b dans le forum Électronique
    Réponses: 5
    Dernier message: 20/10/2008, 14h59
  3. Pb code vhdl!!!
    Par invitedf5f6b15 dans le forum Électronique
    Réponses: 14
    Dernier message: 29/05/2008, 23h26
  4. Une petite question à propos du VHDL
    Par invite84ff7edc dans le forum Électronique
    Réponses: 5
    Dernier message: 07/02/2008, 17h04
  5. Réponses: 1
    Dernier message: 07/11/2006, 16h53
Dans la rubrique Tech de Futura, découvrez nos comparatifs produits sur l'informatique et les technologies : imprimantes laser couleur, casques audio, chaises gamer...