User manual

DSM tutorials
As the RC200 is a hardware target, a device type must also be specified. Go to the Chip tab in Project
Settings
, make sure that Family is set to Xilinx Virtex-II, Device is set to XC2V1000, Package is set to fg456 and
Speed Grade is set to 4, as shown below.
CHIP TYPE SETTINGS FOR RC200
4.3.2 Seven-segment project in PAL
To use PAL in a project, a target clock rate must be set and the pal_master.hch header file must be
included, as shown below. For the seven-segment examples, the clock rate is not very important – a
value of 20MHz has been set here.
#define PAL_TARGET_CLOCK_RATE 20000000
#include "pal_master.hch"
At the start of the project’s
main function, calls should be made to specify what version of PAL is
required, and what resources we need to be available. For the seven-segment tutorials we want to use
two seven-segment displays, so the required code is as shown below:
PalVersionRequire (1, 2); // require PAL v1.2 or later
PalSevenSegRequire (2); // require two seven-segment displays
Before writing data to the seven-segment displays, they must be enabled using the
PalSevenSegEnable macro. The parameter to this macro should be a call to the PalSevenSegCT
macro, which itself should be passed a number to index into the requested number of displays, as
shown below:
PalSevenSegEnable (PalSevenSegCT (0));
PalSevenSegEnable (PalSevenSegCT (1));
After enabling the displays, data can be written to them, again using calls to
PalSevenSegCT with an
index to identify which display to send the data to, as shown below:
www.celoxica.com
Page 61