OpenCores
URL https://opencores.org/ocsvn/osdvu/osdvu/trunk

Subversion Repositories osdvu

[/] [osdvu/] [trunk/] [README] - Diff between revs 2 and 4

Show entire file | Details | Blame | View Log

Rev 2 Rev 4
Line 66... Line 66...
 
 
 uart MyInstanceName (clk, , rx, tx, transmit, tx_byte, received, rx_byte, , is_transmitting, );
 uart MyInstanceName (clk, , rx, tx, transmit, tx_byte, received, rx_byte, , is_transmitting, );
 
 
== Adjusting Clock Rate / Baud Rate ==
== Adjusting Clock Rate / Baud Rate ==
 
 
The clock rate and baud rate can be altered by changing the CLOCK_DIVIDE parameter passed in to the uart module. This value is calculated by taking the clock frequency in Hz (for example, 50MHz is 50,000,000 Hz), dividing it by the baud rate times 16 (for example 9600)
The clock rate and baud rate can be altered by changing the CLOCK_DIVIDE parameter passed in to the uart module. This value is calculated by taking the clock frequency in Hz (for example, 50MHz is 50,000,000 Hz), dividing it by the baud rate times 4 (for example 9600)
 
 
CLOCK_DIVIDE = Frequency(clk) / (16 * Baud)
CLOCK_DIVIDE = Frequency(clk) / (4 * Baud)
 
 
In the example given, the resulting constant is 50000000 / (16 * 9600) = 325 . This is the value that the module has by default. To create a UART running at a different rate, insert the CLOCK_DIVIDE value in to the initialisation like:
In the example given, the resulting constant is 50000000 / (4 * 9600) = 1302 . This is the value that the module has by default. To create a UART running at a different rate, insert the CLOCK_DIVIDE value in to the initialisation like:
 
 
uart #(.CLOCK_DIVIDE( 325 )) MyInstanceName (clk, ...);
uart #(.CLOCK_DIVIDE( 1302 )) MyInstanceName (clk, ...);
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.