Découvrez notre Chaîne YouTube "Ingénierie et Projets"
Découvrez notre Chaîne Secondaire "Information Neuronale et l'Ingénierie du Cerveau"

Projet électronique FPGA Gestion de l'afficheur 7 ségments schéma 1

Projet électronique FPGA Gestion de l'afficheur 7 ségments schéma 2

Projet électronique FPGA Gestion de l'afficheur 7 ségments schéma 3

Les objectifs du projet :

  1. Manipulation des tableaux en VHDL
  2. Savoir comment utiliser la fonction séquentielle CASE
  3. Comprendre l’intérêt l’utilisation des process en VHDL
  4. Autres astuces de programmation

Analyse de fonctionnement :

Le circuit Process_LED permet d’effectuer le codage binaire sur 4 bits en BCD 7segments. Les entrées IN1-IN4 permettent de sélectionner un nombre entre ‘0’ et ‘9’ en BCD 7 Segments puis afficher la valeur sur les trois afficheurs 7 segments. Les LED affichent en parallèle l’état des interrupteurs de l’entrée.

La notion du Process en VHDL :

Une analogie directe est d’assimiler un signal à une équipotentielle d’un circuit électronique et comparer un process à un sous-programme d’interruption dont le signal d’interruption est un événement survenu sur l’un des signaux déclarés dans la liste de sensibilité du process. Il existe différentes façons de déclarer un process, la façon la plus proche de l’analogie avec le concept d’interruption est :

–Déclaration de process
Nom du process : process (liste de sensibilité)
Begin
— Corps du process
End process nom du process

La liste de sensibilité est constituée de un ou plusieurs signaux, elle peut être vide mais nous n’envisagerons pas ce cas dans cette introduction. Le corps du process peut contenir des affectations de signaux. Ces signaux, s’ils changent d’état, déclencheront à leur tour l’invocation des process dont ils font partie de la liste de sensibilité. Il est alors primordial d’intégrer la notion de causalité et de cycles de simulation pour comprendre le fonctionnement du mécanisme des process.

L’ordre dans lequel ont été évalués les process à chaque delta-cycle n’a pas d’importance. Une simulation VHDL repose sur le principe de concurrence entre des instructions dites concurrentes tels que les process, elles sont concurrentes car elles sont toutes évaluées à un même delta-cycle.

L’évaluation d’une instruction concurrente à un delta-cycle ne peut pas influencer l’évaluation d’une autre instruction concurrente au même delta-cycle. Leur ordre d’apparition à l’intérieur d’une description VHDL n’a donc aucune importance. Par opposition, l’ordre d’évaluation des instructions séquentielles à l’intérieur d’un process doit respecter leur ordre d’apparition, comme pour un langage classique. A un même delta-cycle, une instruction séquentielle peut modifier des objets utilisés au même delta-cycle dans la suite de la description.

Les valeurs en BCD 7 segments pour un afficheur en anode commune sont stockes dans un tableur de taille 10 [0-9].

Particularités d’un Process en VHDL :

Les différents process d’un programme vhdl s’exécutent en parallèle les uns des autres.

  1. Un processus peut avoir des variables locales. Le fonctionnement du processus est régi par les règles suivantes :
  2. Un processus est une boucle infinie , lorsqu’il arrive à la fin du code, il reprend automatiquement au début
  3. Un processus doit être sensible des points d’arrêt, il existe 2 types de points d’arrêts :
    1. Le processus est associé à une « liste de sensibilité » qui réveille le processus lors d’un changement d’un des signaux.
    2. Le processus a des instructions d’arrêt wait dans sa description interne.
  4. Les variables sont internes au processus et sont affectées immédiatement, contrairement aux signaux qui eux ne sont pas affectés directement mais en fin de processus
  5. Un processus est séquentiel dans le sens ou les instructions sont évaluées l’une après l’autre dans l’ordre d’écriture.

 La fonction CASE en VHDL :

On utilise CASE pour permettre le choix entre plusieurs actions. Cette instruction est très utile dans les machines d’états. En fin de liste, on peut ajouter WHEN OTHERS (WHEN OTHERS => NULL) qui permet de donner une action à tous les choix qui n’ont pu être trouvés dans la liste.

CASE expression IS
WHEN choices => sequence_of_statements;
{WHEN choices => sequence_of_statements;}
END CASE;

Case est une fonction séquentielle, donc il faut l’intégrer dans un Process au contraire de la fonction Select.

 Programme VHDL :

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std;

ENTITY Process_LED IS

GENERIC
   (
      N : positive :=8
   );

PORT (

  clk ,IN1, IN2, IN3, IN4 : IN std_logic;
  TransEN1         : OUT std_logic;
  TransEN2         : OUT std_logic;
  TransEN3         : OUT std_logic;
  Seg_value : OUT std_logic_vector(N-1 downto 0);
  LED                 : OUT std_logic_vector(3 downto 0):=x"0"
  );
END Process_LED;


ARCHITECTURE aCmpt OF Process_LED IS

SIGNAL sel : std_logic_vector(3 downto 0);
SIGNAL Seg_temp : std_logic_vector(N-1 downto 0):=x"FF";
type T_DATA is array (0 to 9) of std_logic_vector(N-1 downto 0);


-- Anode commune : Tableau des valeurs en BCD 7 Segments
constant SEG_7 : T_DATA :=

            (x"C0",
                                 x"F9",
             x"A4",
             x"B0",
             x"99",
                                 x"92",
                                 x"82",
                                 x"F8",
                                 x"80",
                                 x"90");


BEGIN
        PROCESS (clk,IN1, IN2, IN3, IN4)
                BEGIN
                        IF (clk'EVENT AND clk='1') THEN
                                CASE sel IS
                                        WHEN x"0" => Seg_temp<=SEG_7(0);         LED <=x"0";
                                        WHEN x"1" => Seg_temp<=SEG_7(1);                LED <=x"1";
                                        WHEN x"2" => Seg_temp<=SEG_7(2);                LED <=x"2";
                                        WHEN x"3" => Seg_temp<=SEG_7(3);                LED <=x"3";
                                        WHEN x"4" => Seg_temp<=SEG_7(4);                LED <=x"4";
                                        WHEN x"5" => Seg_temp<=SEG_7(5);                LED <=x"5";
                                        WHEN x"6" => Seg_temp<=SEG_7(6);                LED <=x"6";
                                        WHEN x"7" => Seg_temp<=SEG_7(7);                LED <=x"7";
                                        WHEN x"8" => Seg_temp<=SEG_7(8);                LED <=x"8";
                                        WHEN x"9" => Seg_temp<=SEG_7(9);                LED <=x"9";
                                        WHEN OTHERS => Seg_temp<=SEG_7(0);        LED <=x"0";
                                END CASE ;
                   END IF;
        END PROCESS;

        Seg_value<=Seg_temp;

--        Le signal sel est la concaténation des 4 entrées
        sel <=IN4&IN3&IN2&IN1;

--        Activation des 3 Afficheurs BCD 7 Segments
        TransEN1 <= '0';
        TransEN2 <= '0';
        TransEN3 <= '0';


END aCmpt; 

Fichier de simulation :

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--USE ieee.numeric_std.ALL;

ENTITY Test_7SEG IS
END Test_7SEG;

ARCHITECTURE behavior OF Test_7SEG IS

    -- Component Declaration for the Unit Under Test (UUT)

    COMPONENT Process_LED
    PORT(
         clk : IN  std_logic;
         IN1 : IN  std_logic;
         IN2 : IN  std_logic;
         IN3 : IN  std_logic;
         IN4 : IN  std_logic;
         TransEN1 : OUT  std_logic;
         TransEN2 : OUT  std_logic;
         TransEN3 : OUT  std_logic;
         Seg_value : OUT  std_logic_vector(7 downto 0);
         LED : OUT  std_logic_vector(3 downto 0)
        );
    END COMPONENT;


   --Inputs
   signal clk : std_logic := '0';
   signal IN1 : std_logic := '0';
   signal IN2 : std_logic := '0';
   signal IN3 : std_logic := '0';
   signal IN4 : std_logic := '0';

         --Outputs
   signal TransEN1 : std_logic;
   signal TransEN2 : std_logic;
   signal TransEN3 : std_logic;
   signal Seg_value : std_logic_vector(7 downto 0);
   signal LED : std_logic_vector(3 downto 0);

   -- Clock period definitions
   constant clk_period : time := 10 ns;

BEGIN

        -- Instantiate the Unit Under Test (UUT)
   uut: Process_LED PORT MAP (
          clk => clk,
          IN1 => IN1,
          IN2 => IN2,
          IN3 => IN3,
          IN4 => IN4,
          TransEN1 => TransEN1,
          TransEN2 => TransEN2,
          TransEN3 => TransEN3,
          Seg_value => Seg_value,
          LED => LED
        );

   -- Stimulus process
   stim_proc: process
   begin
                        wait for 100 ns;

         -- Crctère '1'
                        clk <= not(clk);
                        IN1<= '1';
                        IN2<= '0';
                        IN3<= '0';
                        IN4<= '0';
                        wait for 100 ns;

                        clk <= not(clk);
                        wait for 20 ns ;

                        -- Crctère '2'
                        clk <= not(clk);
                        IN1<= '0';
                        IN2<= '1';
                        IN3<= '0';
                        IN4<= '0';
                        wait for 100 ns;

                        clk <= not(clk);
                        wait for 20 ns ;

                        -- Crctère '3'
                        clk <= not(clk);
                        IN1<= '1';
                        IN2<= '1';
                        IN3<= '0';
                        IN4<= '0';
                        wait for 100 ns;

                        clk <= not(clk);
                        wait for 20 ns ;

                        -- Crctère '4'
                        clk <= not(clk);
                        IN1<= '1';
                        IN2<= '0';
                        IN3<= '1';
                        IN4<= '0';
                        wait for 100 ns;

                        clk <= not(clk);
                        wait for 20 ns ;

                        -- Crctère '7'
                        clk <= not(clk);
                        IN1<= '1';
                        IN2<= '1';
                        IN3<= '1';
                        IN4<= '0';
                        wait for 100 ns;

   end process;

END;

Projet électronique FPGA Gestion de l'afficheur 7 ségments schéma test banch

 

Fichier des contraintes (Pinout.ucf) :

    CONFIG VCCAUX = "3.3" ;
    # Clock 12 MHz
    NET "clk"             LOC = P129  | IOSTANDARD = LVCMOS33 | PERIOD = 12MHz;
    NET "Seg_value[0]"    LOC = P117  | IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 12;
    NET "Seg_value[1]"    LOC = P116  | IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 12;
    NET "Seg_value[2]"    LOC = P115  | IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 12;
    NET "Seg_value[3]"    LOC = P113  | IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 12;
    NET "Seg_value[4]"    LOC = P112  | IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 12;
    NET "Seg_value[5]"    LOC = P111  | IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 12;
    NET "Seg_value[6]"    LOC = P110  | IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 12;
    NET "Seg_value[7]"    LOC = P114  | IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 12;


    NET "TransEN1"                  LOC = P124  | IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 12;
    NET "TransEN2"          LOC = P121  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12;
    NET "TransEN3"          LOC = P120  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12;

    NET "IN1"        LOC = P70   | PULLUP  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12;
    NET "IN2"        LOC = P69   | PULLUP  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12;
    NET "IN3"        LOC = P68   | PULLUP  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12;
    NET "IN4"        LOC = P64   | PULLUP  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12;

    NET "LED[0]"             LOC = P46   | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12;
    NET "LED[1]"             LOC = P47   | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12;
    NET "LED[2]"             LOC = P48   | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12;
    NET "LED[3]"             LOC = P49   | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12;

 

Photos du projet :

Projet électronique FFPGA 2 Gestion de l'aficheur 7 Segments photos (1)

Projet électronique FFPGA 2 Gestion de l'aficheur 7 Segments photos (4)

 

Téléchargement du projet FPGA 2 : Gestion de l’afficheur 7 Segments.

Un petit commentaire de vous, un Grand encouragement pour nous 🙂 

– Bon Courage – 

 

 

Click to rate this post!
[Total: 3 Average: 3.7]

0 commentaire

Laisser un commentaire

Avatar placeholder

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Anti-Robot *

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.
Cookies settings
Accept
Decline
Privacy & Cookie policy
Privacy & Cookies policy
Cookie name Active

Privacy Policy

What information do we collect?

We collect information from you when you register on our site or place an order. When ordering or registering on our site, as appropriate, you may be asked to enter your: name, e-mail address or mailing address.

What do we use your information for?

Any of the information we collect from you may be used in one of the following ways: To personalize your experience (your information helps us to better respond to your individual needs) To improve our website (we continually strive to improve our website offerings based on the information and feedback we receive from you) To improve customer service (your information helps us to more effectively respond to your customer service requests and support needs) To process transactions Your information, whether public or private, will not be sold, exchanged, transferred, or given to any other company for any reason whatsoever, without your consent, other than for the express purpose of delivering the purchased product or service requested. To administer a contest, promotion, survey or other site feature To send periodic emails The email address you provide for order processing, will only be used to send you information and updates pertaining to your order.

How do we protect your information?

We implement a variety of security measures to maintain the safety of your personal information when you place an order or enter, submit, or access your personal information. We offer the use of a secure server. All supplied sensitive/credit information is transmitted via Secure Socket Layer (SSL) technology and then encrypted into our Payment gateway providers database only to be accessible by those authorized with special access rights to such systems, and are required to?keep the information confidential. After a transaction, your private information (credit cards, social security numbers, financials, etc.) will not be kept on file for more than 60 days.

Do we use cookies?

Yes (Cookies are small files that a site or its service provider transfers to your computers hard drive through your Web browser (if you allow) that enables the sites or service providers systems to recognize your browser and capture and remember certain information We use cookies to help us remember and process the items in your shopping cart, understand and save your preferences for future visits, keep track of advertisements and compile aggregate data about site traffic and site interaction so that we can offer better site experiences and tools in the future. We may contract with third-party service providers to assist us in better understanding our site visitors. These service providers are not permitted to use the information collected on our behalf except to help us conduct and improve our business. If you prefer, you can choose to have your computer warn you each time a cookie is being sent, or you can choose to turn off all cookies via your browser settings. Like most websites, if you turn your cookies off, some of our services may not function properly. However, you can still place orders by contacting customer service. Google Analytics We use Google Analytics on our sites for anonymous reporting of site usage and for advertising on the site. If you would like to opt-out of Google Analytics monitoring your behaviour on our sites please use this link (https://tools.google.com/dlpage/gaoptout/)

Do we disclose any information to outside parties?

We do not sell, trade, or otherwise transfer to outside parties your personally identifiable information. This does not include trusted third parties who assist us in operating our website, conducting our business, or servicing you, so long as those parties agree to keep this information confidential. We may also release your information when we believe release is appropriate to comply with the law, enforce our site policies, or protect ours or others rights, property, or safety. However, non-personally identifiable visitor information may be provided to other parties for marketing, advertising, or other uses.

Registration

The minimum information we need to register you is your name, email address and a password. We will ask you more questions for different services, including sales promotions. Unless we say otherwise, you have to answer all the registration questions. We may also ask some other, voluntary questions during registration for certain services (for example, professional networks) so we can gain a clearer understanding of who you are. This also allows us to personalise services for you. To assist us in our marketing, in addition to the data that you provide to us if you register, we may also obtain data from trusted third parties to help us understand what you might be interested in. This ‘profiling’ information is produced from a variety of sources, including publicly available data (such as the electoral roll) or from sources such as surveys and polls where you have given your permission for your data to be shared. You can choose not to have such data shared with the Guardian from these sources by logging into your account and changing the settings in the privacy section. After you have registered, and with your permission, we may send you emails we think may interest you. Newsletters may be personalised based on what you have been reading on theguardian.com. At any time you can decide not to receive these emails and will be able to ‘unsubscribe’. Logging in using social networking credentials If you log-in to our sites using a Facebook log-in, you are granting permission to Facebook to share your user details with us. This will include your name, email address, date of birth and location which will then be used to form a Guardian identity. You can also use your picture from Facebook as part of your profile. This will also allow us and Facebook to share your, networks, user ID and any other information you choose to share according to your Facebook account settings. If you remove the Guardian app from your Facebook settings, we will no longer have access to this information. If you log-in to our sites using a Google log-in, you grant permission to Google to share your user details with us. This will include your name, email address, date of birth, sex and location which we will then use to form a Guardian identity. You may use your picture from Google as part of your profile. This also allows us to share your networks, user ID and any other information you choose to share according to your Google account settings. If you remove the Guardian from your Google settings, we will no longer have access to this information. If you log-in to our sites using a twitter log-in, we receive your avatar (the small picture that appears next to your tweets) and twitter username.

Children’s Online Privacy Protection Act Compliance

We are in compliance with the requirements of COPPA (Childrens Online Privacy Protection Act), we do not collect any information from anyone under 13 years of age. Our website, products and services are all directed to people who are at least 13 years old or older.

Updating your personal information

We offer a ‘My details’ page (also known as Dashboard), where you can update your personal information at any time, and change your marketing preferences. You can get to this page from most pages on the site – simply click on the ‘My details’ link at the top of the screen when you are signed in.

Online Privacy Policy Only

This online privacy policy applies only to information collected through our website and not to information collected offline.

Your Consent

By using our site, you consent to our privacy policy.

Changes to our Privacy Policy

If we decide to change our privacy policy, we will post those changes on this page.
Save settings
Cookies settings

You have successfully subscribed to the newsletter

There was an error while trying to send your request. Please try again.

FPGA | Arduino | Matlab | Cours will use the information you provide on this form to be in touch with you and to provide updates and marketing.