
FSL Events Tutorial
Learning Objectives
- Learn how to incorporate a new core (FSL Peripheral) into a project.
- Learning the basic operation of the FSL Event Handler Peripheral.
Learning Resources
- Course lectures.
- EDK documentation (located in C:\EDK\Docs).
Tutorial Overview
This tutorial will walk you through adding an existing IP core to a project
you create. In addition, you will learn the basics of using the FSL
Event Handler to create interactive MicroBlaze C programs.
Preparing for the tutorial
- Copy your Hello_World EDK project to a new directory where you
will modify it. This tutorial will use FslEvents as the project
directory name.
- Download the supplied system.c
file into your project directory
(the FslEvents directory).
The Tutorial - Quick Steps
- Open your project
- Add the public peripherals directory to your project.
- Add IP cores to the project.
- Modify the system.ucf file.
- Configure the peripherals.
- Build and download your bit file.
The Tutorial - Detailed steps
- Open the newly copied EDK Project
Double click on the system.xmp file in your FslEvents Directory.
- Click on the "Project" menu and select "Project Options..."
The "Project Options" Dialog box will open.
- Type "P:\EDK_Peripherals" in the "Peripheral Repository Directory" text area.
- Click "OK".
- It will tell you that you have changed the library search path,
and it will ask you if you want to save the settings now and
rescan the directories.
- Click "Yes".
- Quit out of EDK by going to the "File" menu and selecting "Exit"
- Re-Open the EDK Project
by double clicking on the system.xmp file in your FslEvents Directory.
- Add IP Cores.
- Click on the "Project" menu and select the option "Add/Edit Cores..."
- In the "Add/Edit Hardware Platform Specifications" dialog
box, do the following:
- Add the new Peripherals
- Select the "Peripherals" tab if it is not already selected.
- Add an fsl_event_handler peripheral.
- Add an opb_gpio peripheral.
- Add a reset_debounce peripheral.
- Click the Apply button. (This just saves your changes
without closing the dialog box)
- Add and configure buses.
- Select the "Bus Connections" tab.
- Add two FSL buses (fsl_v20_v2_00_a).
- Attach the GPIO peripheral as a slave on the OPB Bus.
- Select the "Parameters" tab.
- On the right hand side select "MicroBlaze_0"
- Add the "C_FSL_Links" parameter and change its value to
"1". (This creates one bi-directional FSL Port on the MicroBlaze)
- Go back to the "Bus Connections" tab.
- Attach the MicroBlaze and the event handler to the FSL buses.
- When finished, the Bus Connections
tab should appear as follows:

- Click the Apply button.
- Assign Peripheral Addresses.
- Select the "Addresses" tab.
- Set the base address of the OPB_GPIO peripheral to the next
available address (It should be 0x80000200).
- Set the size of the OPB_GPIO peripheral to 512.
- Click the Apply button.
- Update ports.
- Select the "Ports" tab.
- For the fsl_v20_0, do the following:
- Add FSL_Clk
- Add SYS_Rst
- Rename FSL_Clk Net Name to Clk50Mhz.
- Rename SYS_Rst Net Name to RstSig.
- For the fsl_v20_1, do the same.
- For the obp_gpio_0, do the following:
- Add GPIO_IO
- Rename GPIO Net Name to IO.
- Select the IO Net and click "Make External"
- Set the IO range field (In the top window pane) to [0:13].
- For the fsl_event_handler_0, do the following:
- Add sys_clk
- Add sys_rst
- Add Buttons
- Rename sys_clk Net Name to Clk50Mhz.
- Rename sys_rst Net Name to RstSig.
- Rename Buttons Net Name to EHButtons.
- Select the EHButtons Net and click "Make External"
- Set the EHButtons range field (In the top window pane) to [0:1].
- For the reset_debounce, do the following:
- Add CLK
- Add BTN_IN
- Add RST_OUT
- Rename CLK Net Name to Clk50Mhz.
- Rename BTN_IN Net Name to BTN0.
- Rename RST_OUT Net Name to RstSig.
- Change all other BTN0 signals (except for the BTN_IN
of the reset_debounce) to RstSig. You should only
need to change them in both the LMB Buses, and the
OPB Bus.
- When finished, the Bus Connections
tab should appear as follows:

- Click the Apply button.
- Update your ucf file.
- In the windows explorer, open your project directory (the
FslEvents directory)
- In your project directory there should be a "data"
directory. Open it.
- In the data directory there should be a system.ucf file.
Open it in emacs by double clicking it.
- In your ucf file you will need to add SW0, SW1, SW2, BTN1, the
signals for the 7-segment display.
- BTN1 should be renamed to EHButtons<0>
- SW0 should be renamed to EHButtons<1>
- SW2 should be renamed to IO<0>
- SW1 should be renamed to IO<1>
- AN3 should be renamed to IO<2>
- AN2 should be renamed to IO<3>
- AN1 should be renamed to IO<4>
- AN0 should be renamed to IO<5>
- CA should be renamed to IO<6>
- CB should be renamed to IO<7>
- CC should be renamed to IO<8>
- CD should be renamed to IO<9>
- CE should be renamed to IO<10>
- CF should be renamed to IO<11>
- CG should be renamed to IO<12>
- CDP should be renamed to IO<13>
- Save your changes and quit out of emacs.
- Return to Platform Studio (EDK) where we left it. You
should still have the "Add/Edit Hardware Platform
Specifications" dialog open to the "Ports" Tab.
- Set the Parameters for the new peripherals.
- Select the "Parameters" tab.
- On the right hand side select "event_handler_0" and set
the following parameters
- Add the "C_USE_CUSTOMS" parameter and change its value to "0".
- Add the "C_USE_KEYBOARD" parameter and change its value to "0".
- Add the "C_USE_MOUSE" parameter and change its value to "0".
- Add the "C_NUM_TIMERS" parameter and change its value to "2".
- Add the "C_NUM_BUTTONS" parameter and change its value to "2".
- Add the "C_DEBOUNCE_CLKS" parameter and change its value to "16384".
- On the right hand side select "opb_gpio_0" and set
the following parameters
- Add the "C_GPIO_WIDTH" parameter and change its value to "14".
- Click the OK button. This will close the "Add/Edit Hardware Platform
Specifications" dialog.
- Build and download your bit file.
- Click the download button on the toolbar (to compile
and download your project to the Xilinx board):