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.

RS232 vhd controller

Status
Not open for further replies.

JoseL

Newbie level 5
Joined
Apr 19, 2014
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
80
hello everybody,

I’m trying to understand how is working the rs232 controller, and I thing I have understood nearly everything, the only thing I can’t understand properly is how calculate the oversampling value to get the data, I mean the baud rate.
I’m working with the digilent’s code RS232RefComp.vhd (https://github.com/ibm2030/IBM2030/blob/master/RS232RefComp.vhd) , at the line 76 is where the sampling rate is calculated, I copy/paste that line:

constant baudDivide : std_logic_vector(7 downto 0) := "10100011"; --Baud Rate dividor, set now for a rate of 9600. Found by dividing 50MHz by 9600 and 16.

When I do the same operation (50000000/9600)/16 it gives me = 325.5 which is aprox. the double than the one is at the code ("10100011" = 163) if I divide per 32 instead 16 the operations match with of the code.

What I’m doing wrong? What’s I missing?

Thank you very much in advance.
Regards.
 

baudDivide is used to generate not CLK signal. So Actural TCLK frequency is 2* that name as u calculated.
Anyway i discourage learning from that code. Gated clocks, state machines with wrong sensivity list etc.... there are much easier UART driver codes posted on net
like this one http://www.bealto.com/fpga-uart_io.html
 
  • Like
Reactions: JoseL

    JoseL

    Points: 2
    Helpful Answer Positive Rating
Take a look at the clock generation it is probably toggling based on the baud rate.

Regards
 
  • Like
Reactions: JoseL

    JoseL

    Points: 2
    Helpful Answer Positive Rating
Thank you very much for you help and soon reply, I will have a look to the link.
Thanks again.
Regards.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top