Tom's Guide > Forum > Programmation > erreur vhdl
Mot :    Pseudo :           
 

Bonjour, j'ai une erreur sur mon programme vhdl que je n'arrive pas à résoudre. Cette erreur me dit "Multiple non-tristate drivers for net s(0) in RECEP" et je ne la comprends pas.

Si besoin voici le programme en question qui est censé recevoir une température codée sur 2 octets de 8 bits (E) depuis un PIC18F4420 et les converti pour les envoyer sur 3 digits 7 segments. On n'utilise qu'une seule sortie (S) et c'est un jeu de transistor qui va sélectionner les digits à tour de rôle (d'où les variables C,D,U). La sortie L est une diode d'alarme si on a une température > 80°C

library ieee;
use ieee.std_logic_1164.all;

entity RECEP is
port(E : in std_logic;
CK : in std_logic;
S : out std_logic_vector (6 downto 0);
C,D,U,L : out std_logic);
end;

architecture rp of RECEP is

signal Z : integer range 0 to 65;
signal Cent,Diz,Unit : std_logic_vector (3 downto 0);
signal B : std_logic;
signal i,P,m : integer range 0 to 4;

begin
COMPTE : process(CK,E)
begin
if falling_edge (E) then
B<='1';
end if;
if (rising_edge (CK) and B='1') then
Z<=Z+1;
if (Z=32) then
P<=1;
Z<=0;
end if;
if ((Z=64) and (P=1)) then
Unit(i)<=E;
i<=i+1;
Z<=0;
if (i=3) then
i<=0;
Z<=0;
P<=2;
U<='1';
D<='0';
C<='0';
end if;
end if;


if ((Z=64) and (P=2)) then
Diz(i)<=E;
i<=i+1;
Z<=0;
if (i=3) then
i<=0;
Z<=0;
P<=3;
U<='0';
D<='1';
C<='0';
end if;
B<='0';
end if;
end if;
if falling_edge (E) then
B<='1';
end if;
if ((rising_edge(CK)) and (P=3) and (B='1')) then
Z<=Z+1;
if (Z=32) then
P<=1;
Z<=0;
end if;
if ((Z=64) and (P=1)) then
Cent(i)<=E;
i<=i+1;
Z<=0;
if (i=3) then
i<=0;
Z<=0;
P<=0;
U<='0';
D<='0';
C<='1';
end if;
end if;

end if;


if (Diz>="1000" or Cent<"0000" ) then
L<='1';
else
L<='0';
end if;

end process;

with Cent select
S <= "1111110" when "0000",
"0110000" when "0001",
"1001111" when others;

with Diz select
S <= "1111110" when "0000",
"0110000" when "0001",
"1101101" when "0010",
"1111001" when "0011",
"0110011" when "0100",
"1011011" when "0101",
"0011111" when "0110",
"1110000" when "0111",
"1111111" when "1000",
"1110011" when "1001",
"1001111" when others;

with Unit select
S <= "1111110" when "0000",
"0110000" when "0001",
"1101101" when "0010",
"1111001" when "0011",
"0110011" when "0100",
"1011011" when "0101",
"0011111" when "0110",
"1110000" when "0111",
"1111111" when "1000",
"1110011" when "1001",
"1001111" when others;
end rp;

Je vous remercie d'avance pour vos réponses qui je suis sur me sauront d'une grande aide. Bonne journée

Liens sponsorisés
Inscrivez-vous ou connectez-vous pour masquer ceci.

En fait c'est bon, j'ai trouvé ^^
C'est mon "multiplexeur" qui n'allait pas à la fin. Je modifiais plusieurs fois S, donc le programme plantait. Pour ceux que ça intéresse, il suffi de faire une nouvelle variable de 4 bits, à laquelle on attribue à tour de rôle Unit, Diz et Cent et pour le multiplexeur :
with T select
S <= "1111110" when "0000",
"0110000" when "0001",
"1101101" when "0010",
"1111001" when "0011",
"0110011" when "0100",
"1011011" when "0101",
"0011111" when "0110",
"1110000" when "0111",
"1111111" when "1000",
"1110011" when "1001",
"1001111" when others;
Voili, voulou !
a bientôt

Répondre à tutur31270
Tom's Guide > Forum > Programmation > erreur vhdl
Aller à :

Il y a 373 utilisateurs connus et inconnus. Pour voir la liste des connectés connus, cliquez ici.

Attention

Vous allez répondre sur un sujet resté inactif pendant plus de 6 mois.
Assurez-vous d'apporter des éléments nouveaux à la discussion avant de poursuivre.

Répondre Annuler
Liens