VGA schrieb:
> Hallo,
> ich verzweifel langsam. Ich will einen einfachen VGA-Controller
> schreiben und bekomme auch ein Bild auf dem Monitor angezeigt. Der
> Monitor gibt immer eine Fehlermeldung aus bezüglich Auflösung und
> Frequenz. Deshalb gehe ich von einem Timing-Problem aus.
>
> Hier mein VHDL Code
>
>
1 | > elsif( counter_h >= 1640 and counter_h < 1688 )
|
2 | > red<=(others => '0');
|
3 | > green<=(others => '0');
|
4 | > blue<=(others => '0');
|
5 | > elsif( counter_v < 41 )
|
6 | > red<=(others => '0');
|
7 | > green<=(others => '0');
|
8 | > blue<=(others => '0');
|
9 | > elsif( counter_h >= 1065 and counter_h < 1066 )
|
10 | > red<=(others => '0');
|
11 | > green<=(others => '0');
|
12 | > blue<=(others => '0');
|
13 |
|
14 | >
|
der "else if" Zweig counter_h >= 1065 ist toter code da es ein paar
zeilen drüber den Zweig if ( counter_h >= 1640 and counter_h < 1688
gibt. Sollte jetz aber nicht das problem sein.
Verdrahtungsproblem kann auch ein problem sein oder takt fehlt. Wenn du
ein scop hast dann schau dir mal die signale am Kabel an. Pinout
checken, vielleicht ist ja sync am falschen Pin. Ohne scope sind die
syncs auch messbar. schick sie einfach über andere pins wieder in den
FPGA und leg sie auf counter die bspw bei vsync auf 60 zählen und dann
einen ausgang mit LED negieren, die blinkt dan im sekundentakt. Oder du
hast ein Multimeter mit Frequenzmesser.
Die syncs im resetfall (counter = 0) auf den selben Wert setzen wie im
Normalbetrieb (bei dir '0').
1 | if reset='1' then
|
2 | counter_h <= (others => '0');
|
3 | counter_v <= (others => '0');
|
4 | hsync<='1'; --besser '0'
|
5 | vsync<='1';
|
6 |
|
7 |
|
8 | elsif rising_edge(clk) then
|
9 |
|
10 |
|
11 | --generate v- and hsync
|
12 | if counter_h<112 then
|
13 | hsync<='0';
|
14 | else
|
15 | hsync<='1';
|
16 | end if;
|
17 |
|
18 | if counter_v<3 then
|
19 | vsync<='0';
|
20 | else
|
21 | vsync<='1';
|
22 | end if;
|
In dem process wird der reset/clk Zweig zu früh beendet. Ich habs mal
neu eingerückt, da siehts man besser:
1 | process(clk, reset) is
|
2 |
|
3 | begin
|
4 | if reset='1' then
|
5 | counter_h <= (others => '0');
|
6 | counter_v <= (others => '0');
|
7 | hsync<='1';
|
8 | vsync<='1';
|
9 | red<=(others => '0');
|
10 | green<=(others => '0');
|
11 | blue<=(others => '0');
|
12 |
|
13 | elsif rising_edge(clk) then
|
14 |
|
15 | if counter_h<1688 then
|
16 | counter_h <= counter_h+1;
|
17 | else
|
18 | counter_h<= (others => '0');
|
19 | if counter_v<1066 then
|
20 | counter_v<=counter_v+1;
|
21 | else
|
22 | counter_v<=(others => '0');
|
23 | end if;
|
24 | end if;
|
25 | end if;
|
es könnte gut sein das die syncs ungebuffert laufen (spikes wegen
counterumschaltung), nach richtiger synchroner Beschreibung sieht das
nicht aus.
MfG,