User manual

RC200/203 Manual
www.celoxica.com Page 39
5.2 Clock definitions
To set the clock, you need to define one of the 4 preprocessor macros listed below,
before including
rc200.hch in your source code. If none of these are defined, no clock is
set.
RC200_CLOCK_USER
RC200_CLOCK_EXPCLK0
RC200_CLOCK_EXPCLK1
RC200_TARGET_CLOCK_RATE
You can check the actual clock rate of your design using
RC200_ACTUAL_CLOCK_RATE.
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,