Xilinx Frequency Generator, Frequency Generator for Spartan-3E Starter Kit User Manual

Xilinx Frequency Generator, Frequency Generator for Spartan-3E Starter Kit User Manual

Frequency Generator


Spartan-3E Starter Kit

Ken Chapman

Xilinx Ltd

18th July 2006

With special thanks to

Peter Alfke and Alireza Kaviani.



Limited Warranty and Disclaimer. These designs are provided to you “as is”. Xilinx and its licensors make and you receive no warranties or conditions, express, implied, statutory or otherwise, and Xilinx specifically disclaims any implied warranties of merchantability, non-infringement, or fitness for a particular purpose. Xilinx does not warrant that the functions contained in these designs will meet your requirements, or that the operation of these designs will be uninterrupted or error free, or that defects in the Designs will be corrected. Furthermore, Xilinx does not warrant or make any representations regarding use or the results of the use of the designs in terms of correctness, accuracy, reliability, or otherwise.

Limitation of Liability. In no event will Xilinx or its licensors be liable for any loss of data, lost profits, cost or procurement of substitute goods or services, or for any special, incidental, consequential, or indirect damages arising from the use or operation of the designs or accompanying documentation, however caused and on any theory of liability. This limitation will apply even if Xilinx has been advised of the possibility of such damage. This limitation shall apply not-withstanding the failure of the essential purpose of any limited remedies herein.

This design module is not supported by general Xilinx Technical support as an official Xilinx Product. Please refer any issues initially to the provider of the module.

Any problems or items felt of value in the continued improvement of KCPSM3 or this reference design would be gratefully received by the author.

Ken Chapman

Senior Staff Engineer – Spartan Applications Specialist email: chapman@xilinx.com

The author would also be pleased to hear from anyone using KCPSM3 with information about your application and PicoBlaze has been useful.

Frequency Generator for the Spartan-3E Starter Kit 2

Output Frequency provided on SMA socket

Design Overview

This design converts the Spartan-3E Starter Kit into a reasonably accurate frequency generator covering the nominal range 1Hz to 100MHz. The design allows you to attempt generation of higher frequencies to allow you to experiment with the maximum performance of the Spartan device on your board. The rotary control is used to edit the frequency displayed on the upper line of the LCD display and the corresponding frequency will then be output on the SMA connector (J17) as well as the stake pin J4-IO12. Internally to the device the frequency range is twice that provided externally (nominally up to 200MHz).

As well as providing the basic instructions to use the frequency counter, this document provides details of the Direct Digital Synthesis (DDS) techniques used in the design such that the can be transplanted into your own designs. PicoBlaze is used to provide the human interface and perform so high precision calculations which are passed to a simple but high performance (200MHz) frequency synthesizer formed from pure hardware and two Digital Clock Managers (DCMs). The lower line of the LCD display provides the information passed from PicoBlaze to the hardware which means that you can use this design with your board to determine the exact values required to implement a fixed frequency synthesizer without requiring PicoBlaze, the knob and LCD display. On this board the technique provides a convenient alternative to fitting a special oscillator in the IC16 socket and it may proves a cost effective solution for many real product applications too.

Load it now – it only takes 30 seconds!

It is recommended that you try this to become familiar with what the design does (operating instructions on the next page).

As well as the source design files, a compiled configuration bit file is provided which you can immediately download into the Spartan XC3S500E device on your board. To make this task really easy the first time, unzip all the files provided into a directory and then….

double click on ‘install_frequency_generator.bat’.

Assuming you have the Xilinx software installed, your board connected with the USB cable and the board powered (don’t forget the switch), then this should open a DOS window and run iMPACT in batch mode to configure the Spartan-3E with the design.

Spartan XC3S500E

50MHz Reference

Crystal Oscillator


Press and rotate knob

DDS control values

to set frequency

(bottom line)




Test Point


Copy of Output


LEDs indicate frequency editing mode

Frequency display (top line)

Frequency Generator for the Spartan-3E Starter Kit 3

Operating Instructions

Output frequency provided on SMA connector (J17) and J4_IO12.

LEDs indicate the editing mode.

= Edit cursor position mode

= Edit digit value mode

Press and release knob to toggle between frequency editing modes

Edit cursor position mode

In this mode rotating the knob to the left or right will cause the display cursor to move in the corresponding direction on the upper line of the display. Use this mode to position the cursor below the digit you wish to adjust and then press and release the knob to change mode. The cursor automatically skips past the decimal point and space separator and hits ‘end stops’ if you over rotate the knob.

The cursor can be moved into the 10MHz and 100MHz digit positions but these positions are blanked when zero.

The cursor is the small black line under the digit in the top line.

Edit digit value mode

In this mode rotating the knob to the left or right will decrement or increment the value of the digit located at the cursor position. The controller will automatically borrow from, or carry to, the more significant digits to the left of the digit being adjusted. Every adjustment will immediately result in the corresponding frequency change at the output which is also reflected by the changes to the computed DDS control values on the lower line of the display. Press and release the knob to revert to cursor position mode when complete.

Frequency Generator for the Spartan-3E Starter Kit 4

PicoBlaze Design Size

The images and statistics on this page show that the design occupies just 172 slices, 1 BRAM and 2 DCMs. This is only 3.7% of the slices available in an XC3S500E device. More significantly, this slice count can be reduced to less than 32 when implementing a fixed frequency version.

MAP report





PicoBlaze makes extensive use of the distributed memory features of the

Number of occupied Slices:


out of



Spartan-3E device leading to very high design efficiency. If this design

Number of Block RAMs:


out of



was replicated to fill the XC3S500E device, it would represent the



out of



equivalent of over 1.5 million gates. Not bad for a device even marketing






claims to be 500 thousand gates

Total equivalent gate count for design: 91,537



FPGA Editor view



Floorplanner view









Frequency Generator for the Spartan-3E Starter Kit 5

+ 9 hidden pages