tmahlburg / picosoc-basys3

Wrapper module for the PicoSoC to support the Digilent Basys 3
1 stars 0 forks source link

about ser_half_period #3

Closed xralphack closed 9 months ago

xralphack commented 1 year ago

Do you know why

localparam ser_half_period = 53;
tmahlburg commented 1 year ago

It has been a while, but if I recall correctly, it has something to do with the clock provided to the simpleuart.v module, where the baud rate usually differs from the clock rate. See this sentence in the picosoc module: https://github.com/YosysHQ/picorv32/blob/f00a88c36eaab478b64ee27d8162e421049bcc66/picosoc/README.md?plain=1#L63

The UART Clock Divider Register must be set to the system clock frequency divided by the baud rate.

But I don't recall why it was 53 exactly.

The test bench here is mostly copied from hk8demo_tb.v(https://github.com/YosysHQ/picorv32/blob/master/picosoc/hx8kdemo_tb.v), so maybe you could ask at the picorv32 repository for more information.