The HERON_IO5V example4 - Hunt Engineering Ltd.
The HERON_IO5V example4 - Hunt Engineering Ltd.
The HERON_IO5V example4 - Hunt Engineering Ltd.
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
HUNT ENGINEERING<br />
Chestnut Court, Burton Row,<br />
Brent Knoll, Somerset, TA9 4BP, UK<br />
Tel: (+44) (0)1278 760188,<br />
Fax: (+44) (0)1278 760199,<br />
Email: sales@hunteng.co.uk<br />
www.hunteng.co.uk<br />
www.hunt-dsp.com<br />
<strong>The</strong> <strong>HERON</strong>_<strong>IO5V</strong> <strong>example4</strong><br />
Rev 1.2 T. Hollis 29-04-05<br />
<strong>The</strong> <strong>HERON</strong>-<strong>IO5V</strong> module is a module that has an FPGA and 2 channels of fast A/D along with 2<br />
channels of fast D/A.<br />
Most users will use the FPGA to provide either a custom I/O capability or a processing resource that<br />
uses the FPGA for that processing. In that case the Example4 project can form a starting point for the<br />
development of that.<br />
Example4 is provided for users who want to use the FPGA to handle and process data between the<br />
A/Ds and D/As, but will not interface with the <strong>HERON</strong> FIFOs. A user who is embedding a <strong>HERON</strong>-<br />
<strong>IO5V</strong> into a system is an example of this.<br />
History<br />
Example revision 1.0 08-04-04 Document first written for <strong>HERON</strong>-<strong>IO5V</strong><br />
Example revision 1.1 08-03-05 Example updated to run at 160MSPS continuous<br />
Example revision 1.2 29-04-05 Removed reference to specific ISE versions<br />
HUNT ENGINEERING is a trading style of HUNT ENGINEERING (U.K.) <strong>Ltd</strong>, Co Reg No 3333633<br />
Directors P.Warnes & N.J.Warnes. Reg’d office 34 & 38 North St, Bridgwater, Somerset TA6 3YD. VAT Reg’d No GB 515 8449 31
What the bitstream does<br />
<strong>The</strong> (Embedded Analogue I/O) <strong>example4</strong> project for the <strong>HERON</strong>-<strong>IO5V</strong> is supplied on the HUNT<br />
ENGINEERING CD, along with the bitstream that can be loaded directly onto the <strong>HERON</strong>-<strong>IO5V</strong>.<br />
If you make changes to the project and re-build it you can change the functionality to be whatever you<br />
want, but if you use the supplied bit stream you need to know what it is doing.<br />
Clock Generation<br />
<strong>The</strong> standard clock soldered to “User Osc1” of the <strong>HERON</strong>-<strong>IO5V</strong> is 100MHz. Example 4 uses one of<br />
the Digital Clock Managers (DCM) as a Digital Frequency Synthesiser (DFS) to generate a 160MHz<br />
clock from the 100MHz “User Osc1”.<br />
In Example 4 the A/D’s and D/A’s have the same sample clock frequency of 160MHz, which has been<br />
chosen as it is the maximum frequency that digital sample values can be transferred to the D/A<br />
converters.<br />
A/D Converters<br />
<strong>The</strong> Example 4 bitstream uses both channels of A/D and both channels of D/A. <strong>The</strong> samples from A/D<br />
component A are replayed on D/A channel A, and the inputs from A/D B are simply replayed on D/A<br />
channel B. Both the A/D’s and D/A’s are clocked at the same rate of 160MHz.<br />
<strong>The</strong> output of each of the A/D converters is two 12bit data busses and a ‘data clock’ output that runs at<br />
half the sample frequency. <strong>The</strong> two digital values on the two 12 bit busses are the values for two<br />
consecutive samples, these values are clocked into the FPGA using the ‘data clock’ which in the<br />
example runs at (160MHz / 2) = 80MHz .<br />
On the ‘User_Ap4’ interface to the Hardware Interface Layer (HIL) the two 12bit busses for A/D<br />
converter A are ‘ADC_A_A’ and ‘ADC_A_B’ with the data clock is ‘ADC_DCO_A’ and for A/D<br />
converter B they are ‘ADC_B_A’ and ‘ADC_B_B’ with the data clock is ‘ADC_DCO_B’.<br />
Both of the A/D converter data clocks are doubled in frequency back to 160MHz using DCM’s as<br />
frequency doublers. This retains the timing between of the data from the converters and the two<br />
160MHz clocks. <strong>The</strong> frequency doubling DCM’s need to be held in reset until the input clock is stable,<br />
and in this example this means the DFS that is generating the 160MHz must have acquired lock .<br />
<strong>The</strong> two new 160MHz clocks can now be used to multiplex the data from A/D converter A onto a<br />
single 12bit buss running at 160MHz, and data from A/D converter B can be multiplexed onto another<br />
12bit buss running at 160MHz.<br />
At this point the both data busses are shifted by 4bits to make 16bit words. <strong>The</strong>se 16bit sample values<br />
are then clocked into two FIFO’s at 160MHz.<br />
D/A Converters<br />
<strong>The</strong> two D/A converters on the <strong>HERON</strong>-<strong>IO5V</strong> are clocked with a single D/A sample clock, which in this<br />
example is 160MHz from the output of the DFS. <strong>The</strong> read and write clocks on the two FIFO’s will all be<br />
exactly the same frequency but the timing is undefined, which is why the FIFO’s have to be included.<br />
<strong>The</strong> HUNT ENGINEERING Hardware Interface Layer for the D/A converters also includes a DCM, which<br />
ensures the correct timing of the D/A data relative to the ‘da_data_clock’. This DCM must be held in reset<br />
until the 160MHz from the DFS is stable.<br />
2
HSB<br />
No use is made of the HSB interface, but please note the HE_USER component is still placed and tied<br />
inactive to prevent unconnected signals being interpreted as a request to send an HSB message.<br />
Example 4 is a good confidence check for using with embedded modules. It can be configured into the<br />
FPGA using the HSB, or from the (optional) PROM. When the part is configured signals on the<br />
module analogue inputs should be seen re-constructed on the module analogue outputs.<br />
FUNCTIONAL BLOCK DIAGRAM<br />
2<br />
channels<br />
A/D<br />
FIFO’s and<br />
Formatting<br />
2<br />
channels<br />
D/A<br />
<strong>HERON</strong><br />
I/F<br />
HSB<br />
I/F<br />
Inactive<br />
Where are the bitstream and examples?<br />
<strong>The</strong> bit streams for this example can be found on the HUNT ENGINEERING CD under<br />
\fpga\io5v\embedded_IO(ex4). <strong>The</strong> name of the .hcb file reflects the FPGA part number i.e.<br />
2v1500fg676.hcb.<br />
<strong>The</strong>re are no DSP or host example as this is an example for stand alone use.<br />
An easier way to navigate to the correct directory is to select the “Files” link next to the “Embedded<br />
Analog I/O” link under the IP sections of the CD browser.<br />
<strong>The</strong> source files for the FPGA example can be found in the \src subdirectory. <strong>The</strong> sources in the<br />
\io5v\common directory are also required. <strong>The</strong>re is a project for ISE in the ‘ISE’ subdirectory.<br />
3
FPGA example code<br />
You should understand the HUNT ENGINEERING VHDL support for <strong>HERON</strong> modules before<br />
looking at this section. If you do not then please review example1 again (the getting started example<br />
for FPGA modules).<br />
Example4 also has some options that need to be set in the user_ap4.vhdl file, these are:-<br />
SCLK_G_DOMAIN INTERNAL_SCLK_G DIFF_RANGE_A DIFF_RANGE_B<br />
True True False False<br />
For the D/A the correct options are:-<br />
INTERNAL_SCLK_DAC DAC_PLL DAC_FREQ<br />
True False 160<br />
<strong>The</strong> timing constraints for Example 4 are defined in the user constraints file (.ucf) of the design. <strong>The</strong><br />
timing specification for the D/A clock "da_data_clk" is set at the D/A maximum clock frequency of 160<br />
MHz. <strong>The</strong> timing specification for the A/D converters data output clocks "dco_a_n" and "dco_b_n" are<br />
set at 105MHz, which corresponds to the maximum A/D sample frequency of 210MSPS. <strong>The</strong> Example 4<br />
project builds successfully with this timing constraint, even though the sample A/D sample frequency<br />
used is only 160MHz, and so shows that the A/D section of the project could be clocked up to the full<br />
rate of 210MHz<br />
If you add new clock nets into your design then you need to add new timing constraints.