Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

please check this code

Status
Not open for further replies.

j hemangini

Member level 1
Joined
Jul 21, 2008
Messages
35
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,573
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.
 

Your clock and count calculations look ok.

How about your hyperterminal port settings?
I usually use
data bits = 8
parity = none
stop bits = 1
flow control = none
 

I am using the same configuration for port setting.
 

apparently u r transmiting "01010010" which is "R" this is coresponding to the a "0" and first 7 bits of your "1010010011", pls check your counting statement again, you maight start transmitting at wrong count
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top