Hardware description
5.2.1 Specifying a clock source
# define RC200_CLOCK_USER
# define RC200_CLOCK_EXPCLK0
# define RC200_CLOCK_EXPCLK1
Description
To use
CLKUSER
(the FPGA clock) or one of the expansion header clocks, define one of the macros
above before you include
rc200.hch
in your source code. The specified clock will be used by any
subsequent
void main (void)
definition.
Defining
RC200_CLOCK_USER
will select the
CLKUSER
source from the clock generator. Defining
RC200_CLOCK_EXPCLK0
or
RC200_CLOCK_EXPCLK1
will select either
EXPCLK0
or
EXPCLK1
from the
ATA expansion header.
5.2.2 Specifying a clock rate
# define RC200_TARGET_CLOCK_RATE
Description
To set a particular clock rate, use:
# define RC200_TARGET_CLOCK_RATE =
TargetRate
where
TargetRate
is the desired clock frequency in Hertz. A subsequent
void main (void)
definition will use a clock of approximately the desired frequency.
The actual frequency used will be returned in the macro
RC200_ACTUAL_CLOCK_RATE
. If
RC200_TARGET_CLOCK_RATE
is set to 24576000, 25175000, or 50000000 then the 24.576MHz,
25.175MHz or 50MHz on-board clocks will be used (respectively). Otherwise, a DCM will be used in
frequency synthesis mode to generate the nearest approximation to the desired frequency (from a base
of 50MHz). Note that the performance of generated clocks, in terms of parameters like jitter, may be
worse than native clock frequencies. For more details about the DCM, consult the Xilinx Data Book.
Below 24MHz, Handel-C clock dividers will be used to divide the frequency down (since this is the lower
bound of the DCM clock synthesis). This is handled transparently. The range of target frequencies is
from 2MHz to 300MHz, but please note that the achievable frequency is design-dependent and will
typically be much lower than 300MHz.
5.2.3 Checking the clock rate
RC200_ACTUAL_CLOCK_RATE
Description
You can define a target clock rate using the
RC200_TARGET_CLOCK_RATE()
macro. To determine the
actual clock rate of your design, use the compile-time definition:
RC200_ACTUAL_CLOCK_RATE
5.3 Detecting the board type
extern macro expr RC200BoardIsExpert ();
www.celoxica.com
Page 37