[新連載]CPLD入門!
〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜
いつか使うことになるだろうと思ってはいたのですが。
何を今頃になって、というようなものですが。
ようやく本気で、CPLDと四つに取り組みます。
〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜
[第59回]
●CRTIF用VHDLプログラムを80字/40字表示に変更(2)
前回からの続きです。
やっと40字表示で画面が真っ黒になってしまう問題は片付きましたが、まだ問題は残っていました。
新たに気が付いた別の問題です。
●ビット表示がおかしい
これは「40字表示で画面が真っ黒になる」問題とは別件です。
その問題が片付いたあとで気が付きました。
ふと気が付くと、80字表示で文字パターンが欠けています。
’円’や’秒’など横方向の8ビットを全部表示するパターンの右端の1ビットが表示されません。
んな、ばかなはずは。
少し前に撮った画面の写真で確認すると、ちゃんと全ビットが表示されています。
80字/40字表示切換にしてからおかしくなったようです。
8ビットの文字表示での問題ですから、多分cntr1の問題ではないかと考えました。
下は80字表示のみのCRTIF用VHDLプログラムのcntr1の記述です。
--cntr1 & sftrgstr
process(CKIN)
begin
if CKIN'event and CKIN = '1' then
cntr1<=cntr1+"001";
sftrgstr<=sftrgstr(6 downto 0) & '0';
end if;
if CKIN='1' and cntr1="111" then
sftrgstr<=ROMDATA;
end if;
end process;
|
--cntr1 & sftrgstr
process(cntr0)
begin
if cntr0'event and cntr0='0' then
cntr1<=cntr1+"0001";
sftrgstr<=sftrgstr(6 downto 0) & '1';
end if;
if cntr1(3)='1' then
sftrgstr<=ROMDATA;
cntr1<="0000";
end if;
end process;
|
--hblnk,hsync
process(cntr2)
begin
--hblnkwk
if cntr2="0000000" then
hblnkwk<='1';
elsif cntr2="1010000" then
hblnkwk<='0';
end if;
end process;
--
process(cntr2)
begin
--hblnkwk2
if cntr2="0000001" then
hblnkwk2<='1';
elsif cntr2="1010001" then
hblnkwk2<='0';
end if;
end process;
--
process(cntr2)
begin
--hsynkwk
if cntr2="1011001" then
hsyncwk<='0';
elsif cntr2="1100000" then
hsyncwk<='1';
end if;
end process;
|
--hblnk,hsync
process(cntr2)
begin
--hblnkwk
if cntr2="0000000" then
hblnkwk<='1';
elsif SW80_40='1' and cntr2="1010000" then
hblnkwk<='0';
elsif SW80_40='0' and cntr2="0101000" then
hblnkwk<='0';
end if;
end process;
--
process(cntr2)
begin
--hblnkwk2
if cntr2="0000001" then
hblnkwk2<='1';
elsif SW80_40='1' and cntr2="1010001" then
hblnkwk2<='0';
elsif SW80_40='0' and cntr2="0101001" then
hblnkwk2<='0';
end if;
end process;
--
process(cntr2)
begin
--hsynkwk
if SW80_40='1' then
if cntr2="1011001" then
hsyncwk<='0';
elsif cntr2="1100000" then
hsyncwk<='1';
end if;
else
if cntr2="0101101" then
hsyncwk<='0';
elsif cntr2="0110000" then
hsyncwk<='1';
end if;
end if;
end process;
|
--ramadrs
process(cntr2,cntr3,vblnkwk)
begin
if vblnkwk='0' then
ramadrswk<="0000000";
ramadrswk0<="0000000";
elsif cntr3(2 downto 0)="111" and hblnkwk = '0' then
ramadrswk0 <= ramadrswk;
elsif cntr2="1010000" and cntr1(0)='1' then
ramadrswk <= ramadrswk0;
elsif cntr2(3)'event and cntr2(3)='0' and hblnkwk='1' then
ramadrswk<=ramadrswk+"0000001";
end if;
end process;
|
--ramadrs
process(cntr1,cntr2,cntr3,vblnkwk)
begin
if vblnkwk='0' then
ramadrswk<="0000000";
ramadrswk0<="0000000";
elsif cntr3(2 downto 0)="111" and hblnkwk = '0' then
ramadrswk0 <= ramadrswk;
elsif SW80_40='1' and cntr2="1010000" and cntr1(0)='1' then
ramadrswk <= ramadrswk0;
elsif SW80_40='0' and cntr2="0101000" and cntr1(0)='1' then
ramadrswk <= ramadrswk0;
elsif cntr2(3)'event and cntr2(3)='0' and hblnkwk='1' then
ramadrswk<=ramadrswk+"0000001";
end if;
end process;
|