Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you explain why the prescale should be set to Fclk / (baud * 8) according to verilog code? #2

Open
wuzh07 opened this issue Apr 11, 2017 · 1 comment

Comments

@wuzh07
Copy link

wuzh07 commented Apr 11, 2017

In my understanding of verilog code, it seems like (prescale * 8) * 9 bits * baud = Fclk.
*8 because prescale_reg <= (prescale << 3) in verilog code.
*9 because of the transferred 9 bits in 1 symbol.
I'm confused about

The prescale input determines the data rate - it should be set to Fclk / (baud * 8).

Do I understand the code in a wrong way?

@alexforencich
Copy link
Owner

The code waits for prescale*8 clock cycles for each bit transferred. And for RS-232, one bit is one symbol so the baud rate is the same as the bit rate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants