Ik wil met een Basys2 fpga een TLC5940NT IC aansturen. Daarvoor gebruik ik de data kanalen uit de fpga die ik met vhdl probeer te programmeren. (ik heb weinig ervaring met vhdl)
Nu heb ik een probleem met mijn code. een std_logic_vector moet terug op 0 gezet worden maar dit lijkt niet te werken.

In de simulatie is te zien dat program wel op 0 komt maar dat de counter niet gereset wordt.
Ik zie vast iets over het hoofd, iemand die me kan helpen?
alvast bedankt
Nu heb ik een probleem met mijn code. een std_logic_vector moet terug op 0 gezet worden maar dit lijkt niet te werken.
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
| library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.all; entity Main is Port ( CLK: in std_logic; BUTTON: in std_logic; SIN : out STD_LOGIC; SCLK : out STD_LOGIC; XLAT : out STD_LOGIC; BLANK : out STD_LOGIC); end Main; architecture Behavioral of Main is signal counter: std_logic_vector(13 downto 0) := "00000000000000"; signal prescaler: std_logic_vector(1 downto 0) := "00"; signal ISIN, ISCLK, IXLAT, IBLANK : std_logic; signal program : std_logic := '1'; begin counterProcess: process(CLK) begin if rising_edge(CLK) then if prescaler < "10" then prescaler <= prescaler +1; else prescaler <= (others => '0'); if program ='1' then -----------------programmeren-------------------------- if counter = "00000000000000" then ISIN <='0'; ISCLK <='0'; IXLAT <='0'; IBLANK <='0'; elsif counter = "00000000000001" then ISIN <= '1'; elsif counter = "00000110000100" then IBLANK <= '1'; elsif counter = "00000110000101" then IXLAT <= '1'; elsif counter = "00000110000110" then IXLAT <= '0'; elsif counter = "00000110000111" then IBLANK <= '0'; elsif counter = "00000110001000" then program <= '0'; counter <= (others => '0');-----------------------------------<-- dit lijkt niet te werken else IF ISCLK = '1' THEN ISCLK <= '0'; ELSE ISCLK <= '1'; END IF; end if; if program = '1' then counter <= counter +1; end if; else -------------------gsclock---------------------------------- if counter < "10000000000000" then IF ISCLK = '1' THEN ISCLK <= '0'; ELSE ISCLK <= '1'; END IF; counter <= counter +1; else IF IBLANK = '1' THEN IBLANK <= '0'; counter <= (others => '0'); ELSE IBLANK <= '1'; END IF; end if; end if; end if; end if; end process; SIN <= ISIN; SCLK <= ISCLK; XLAT <= IXLAT; BLANK <= IBLANK; end Behavioral; |

In de simulatie is te zien dat program wel op 0 komt maar dat de counter niet gereset wordt.
Ik zie vast iets over het hoofd, iemand die me kan helpen?
alvast bedankt