j hemangini
Member level 1
I have written a code for serial transmission on hyperterminal that is given below.
--------------------------------------------
entity Tx is
Port ( clk : in STD_LOGIC;
TxD : out STD_LOGIC;
switch : in STD_LOGIC);
end Tx;
architecture Behavioral of Tx is
signal count8bit:std_logic:='1';
signal count:integer:=0;
signal Bit_Count:integer:=0;
signal Data_Byte:STD_LOGIC_VECTOR(9 downto 0):= "1010010011";
begin
process(clk)
begin
if clk'event and clk='1' then
count <= count+1;
if count = 5208 then
count <= 0;
TxD <= Data_Byte(0);
for i in 1 to 9 loop
Data_Byte(i-1) <= Data_Byte(i);
end loop;
Bit_Count <= Bit_Count + 1;
if Bit_Count = 10 then
Bit_Count <= 0;
Data_Byte <= "1010010011";
end if;
end if;
end if;
end if;
end process;
end Behavioral;
--------------------------------------------------------------------
Out of this 10 bit fixed format 1010010011, i have used first and last bit as start and stop bit .
Remaining 8 bit format '01001001' is binary code of 'I'. I am communicating on baud rate of 9600.
But issue is that, when i communicate hyperterminal with kit(spartan-3a starter kit)
it starts transmiting 'R' instead of 'I'.
Is there something wrong in this code .
If someone know then please tell me.
thank you.
--------------------------------------------
entity Tx is
Port ( clk : in STD_LOGIC;
TxD : out STD_LOGIC;
switch : in STD_LOGIC);
end Tx;
architecture Behavioral of Tx is
signal count8bit:std_logic:='1';
signal count:integer:=0;
signal Bit_Count:integer:=0;
signal Data_Byte:STD_LOGIC_VECTOR(9 downto 0):= "1010010011";
begin
process(clk)
begin
if clk'event and clk='1' then
count <= count+1;
if count = 5208 then
count <= 0;
TxD <= Data_Byte(0);
for i in 1 to 9 loop
Data_Byte(i-1) <= Data_Byte(i);
end loop;
Bit_Count <= Bit_Count + 1;
if Bit_Count = 10 then
Bit_Count <= 0;
Data_Byte <= "1010010011";
end if;
end if;
end if;
end if;
end process;
end Behavioral;
--------------------------------------------------------------------
Out of this 10 bit fixed format 1010010011, i have used first and last bit as start and stop bit .
Remaining 8 bit format '01001001' is binary code of 'I'. I am communicating on baud rate of 9600.
But issue is that, when i communicate hyperterminal with kit(spartan-3a starter kit)
it starts transmiting 'R' instead of 'I'.
Is there something wrong in this code .
If someone know then please tell me.
thank you.