state <= RSTCLEAR2;
if cnt = 320*240*2-1 then
state <= RSTFINISH;
+ timer <= (others => '0');
end if;
end if;
when RSTCLEAR2 =>
state <= RSTCLEAR;
if cnt = 320*240*2-1 then
state <= RSTFINISH;
+ timer <= (others => '0');
end if;
end if;
when RSTFINISH =>
posrow <= 0;
datapos <= 32; --start of text section
varcnt <= 4; --no nibble active
- state <= WAITSTART;
-
+ if spi_idle = '1' then
+ CS <= '1';
+ if timer(4) = '1' then --set CS again early enough
+ CS <= '0';
+ end if;
+ if timer = x"0000014" then
+ state <= WAITSTART;
+ end if;
+ else
+ timer <= (others => '0');
+ end if;
--------------------------------------------------------------
-- Write text from memory
--------------------------------------------------------------
state <= WAITSTART1;
elsif curdata = x"00" then --end of string
state <= RSTFINISH;
+ timer <= (others => '0');
else --error, skip
datapos <= datapos + 1;
state <= WAITSTART1;