Forum: FPGA, VHDL & Co. Blinker problem


von GAST (Gast)


Lesenswert?

Hallo,

Ich habe für das Spartan-3e Board einen 8 Led blinker programmiert. (8
Led welche mit 1HZ synchron blinken sollten). Jedoch blinkern nur 2 der
8 Leds...

VHDL Code:

entity blinker is
    Port (led : out std_logic_vector(7 downto 0);
          clk : in std_logic);
end jaja;
architecture Behavioral of blinker is
signal      ab : INTEGER range 0 to 50000000;
begin
  count: process(clk)
  begin
if clk'event and clk='1' then
ab<=ab+1;
end if;
if ab=25000000 then
led<="11111111";
end if;
if ab=50000000 then
led<="00000000";
ab<=0;
end if;
end process count;
end Behavioral;

Ich erhalte zudem die Warnung: Found 8-bit latch for signal <led>.
Was hat diese Warnung zu bedeuten? (Die Xilinx erklärung ist mir
unklar.)
Und wieso funktioniert dieser Code nicht korrekt?

von Dirk (Gast)


Lesenswert?

Hi,

du solltest schon alles machen wenn rising edge clk kommt.
1
entity blinker is
2
    Port (led : out std_logic_vector(7 downto 0);
3
          clk : in std_logic);
4
end jaja;
5
6
architecture Behavioral of blinker is
7
signal      ab_int : INTEGER range 0 to 50000000;  
8
signal      led_int : std_logic_vector(7 downto 0);
9
10
begin
11
count: process(clk)
12
begin
13
if clk'event and clk='1' then
14
ab_int<=ab_int+1;
15
if ab=25000000 then
16
led_int<="11111111";
17
end if;
18
if ab=50000000 then
19
led_int<="00000000";
20
ab_int<=0;
21
end if;
22
end if;
23
end process count;
24
led <= led_int;
25
end Behavioral;

von GAST (Gast)


Lesenswert?

Super, danke, hat funktioniert

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.