Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

UART transmitter for FPGA to PC connection using RS232

Status
Not open for further replies.

depanwita

Newbie level 4
Joined
Jan 18, 2011
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,362
I need to develop UART transmitter in VHDL(FPGA to PC through RS232). I have the following code in verilog. Can anyone please provide the corresponding VHDL code or any other code for implementing the desired one.



Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
module transmitter1(clk,reset,transmit,data,TxD);
input clk,reset,transmit;
input[7:0] data;
output TxD;
reg TxD;
reg [3:0] bitcounter;
reg [12:0] counter;
reg state, nextstate;
reg [10:0] rightshiftreg;
reg shift,load,clear;
 
always @(posedge clk)
begin
if (reset) begin
state<=0;
counter<=0;
bitcounter<=0;
end
else begin
counter<=counter+1;
if (counter>=1)
begin
state<=nextstate;
counter<=0;
if(load) rightshiftreg<={1'b1,^data,data,1'b0};
if(clear) bitcounter<=0;
if(shift) begin
rightshiftreg<=rightshiftreg>>1;
bitcounter<=bitcounter+1;
end
end
end
end
 
always @(state or bitcounter or transmit)
begin
load<=0;
shift<=0;
clear<=0;
TxD<=1;
case(state)
0: begin
if(transmit==1)
begin
nextstate<=1;
load<=1;
shift<=0;
clear<=0;
end
else begin
nextstate<=0;
TxD<=1;
end
end
 
1: begin
if(bitcounter>=10)begin
nextstate<=0;
clear<=1;
end
else begin
nextstate<=1;
shift<=1;
TxD<=rightshiftreg[0];
end
end
endcase
end
endmodule

 
Last edited by a moderator:

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
18,060
Helped
4,050
Reputation
8,100
Reaction score
3,963
Trophy points
113
Activity points
119,191
Hi,

i´m not familiar with VHDL.

but UART trasmitter is extremely common... therfore i asked google "VHDL code uart transmitter".
Thousands of results. With code, PDFs, descriptions and a lot of informations.

Why don´t you just pick one of them?

Klaus
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top