Hej
Napisałem program który wysłyła 1 bajt (wartości 0-255) po RSie do terminala. Problem w tym, że na ledach inkrementacja działa - widac jak wysłyłany bajt się zmienia, natomniast na terminalu otrzymuję same zera albo nie poukładna śmieci. Kod wyglada tak:
shared variable temp1 : std_logic_vector(3 downto 0); -- :="11001100";
shared variable temp2 : std_logic_vector(9 downto 0);
signal shiftcounter: std_logic_vector(3 downto 0) := "0000";
signal reg_clock2 : std_logic_vector(23 downto 0);
signal rscounter: std_logic_vector(7 downto 0) := "00000000";
begin
process(clk)
begin
if (CLK'event and CLK = '1') then --rising_edge(CLK_50MHZ) then
if reg_clock2 < 833330 then --600bps
reg_clock2 <= reg_clock2 + 1;
else
reg_clock2 <= (others=>'0');
temp2 := "1"& rscounter&"0"
rscounter <= rscounter +1;
if rscounter = "11111111" then
rscounter <= "00000000";
end if;
result <=rscounter;
txd<=temp2(conv_integer(shiftCounter));
shiftCounter <= shiftCounter +1;
if shiftCounter = "1001" then
shiftCounter <= "0000";
end if;
end if;
end if;
end process;
z góry dzięki za wszelkie sugestie
Napisałem program który wysłyła 1 bajt (wartości 0-255) po RSie do terminala. Problem w tym, że na ledach inkrementacja działa - widac jak wysłyłany bajt się zmienia, natomniast na terminalu otrzymuję same zera albo nie poukładna śmieci. Kod wyglada tak:
shared variable temp1 : std_logic_vector(3 downto 0); -- :="11001100";
shared variable temp2 : std_logic_vector(9 downto 0);
signal shiftcounter: std_logic_vector(3 downto 0) := "0000";
signal reg_clock2 : std_logic_vector(23 downto 0);
signal rscounter: std_logic_vector(7 downto 0) := "00000000";
begin
process(clk)
begin
if (CLK'event and CLK = '1') then --rising_edge(CLK_50MHZ) then
if reg_clock2 < 833330 then --600bps
reg_clock2 <= reg_clock2 + 1;
else
reg_clock2 <= (others=>'0');
temp2 := "1"& rscounter&"0"
rscounter <= rscounter +1;
if rscounter = "11111111" then
rscounter <= "00000000";
end if;
result <=rscounter;
txd<=temp2(conv_integer(shiftCounter));
shiftCounter <= shiftCounter +1;
if shiftCounter = "1001" then
shiftCounter <= "0000";
end if;
end if;
end if;
end process;
z góry dzięki za wszelkie sugestie