Menu

Tree [99b1db] default tip /
 History

Read Only access


File Date Author Commit
 db 2007-12-18 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [7369d0] initial checkin
 test 2007-12-18 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [7369d0] initial checkin
 wrapper 2008-02-13 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [eca088] minor changes in the wrapper
 .hgtags 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 LICENSE 2008-02-21 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [e6d38f] added documentation
 README 2008-10-31 viellieb@pc90-c704.uibk.ac.at viellieb@pc90-c704.uibk.ac.at [99b1db] updated the documentation
 TESTLOG 2008-02-05 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [8b6da4] started testing on real hardware (again)
 TODO 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 V0_1.qsf 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 V0_1_assignment_defaults.qdf 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 constant.vhd 2007-12-18 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [7369d0] initial checkin
 constant_inst.vhd 2007-12-18 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [7369d0] initial checkin
 dds_controller.cdf 2008-10-08 boerge boerge [615bc9] changed firmware to include ramp generator
 dds_controller.dpf 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 dds_controller.jdi 2008-10-08 boerge boerge [615bc9] changed firmware to include ramp generator
 dds_controller.pin 2008-10-08 boerge boerge [615bc9] changed firmware to include ramp generator
 dds_controller.qpf 2008-03-28 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [b768cb] changed the fifo handling. Works most of the ti...
 dds_controller.qsf 2008-10-08 boerge boerge [615bc9] changed firmware to include ramp generator
 dds_controller.stp 2008-10-08 boerge boerge [615bc9] changed firmware to include ramp generator
 dds_controller.vhd 2008-10-08 boerge boerge [615bc9] changed firmware to include ramp generator
 dds_controller.vwf 2008-05-08 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [bca8e5] Added pin for the dds resetall. Changed the wre...
 dds_controller_assignment_defaults.qdf 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 dds_controller_sequencer.vwf 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 dds_controller_sequencer2.vwf 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 dds_serial_bus.dpf 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 dds_serial_bus.pin 2008-01-04 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [066cdf] rewrote the whole state machine and the serial_...
 dds_serial_bus.qpf 2007-12-18 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [7369d0] initial checkin
 dds_serial_bus.qsf 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 dds_serial_bus.qws 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 dds_serial_bus.vhd 2008-04-02 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [2dbb71] phase coherent switching works on real hardware...
 dds_serial_bus.vwf 2007-12-18 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [7369d0] initial checkin
 dds_serial_bus_assignment_defaults.qdf 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 ddslib.vhd 2008-09-04 boerge boerge [fd3299] repaired dds addressing
 dfs.ptf 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 dfs.vhd 2007-12-18 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [7369d0] initial checkin
 fifo_mf.vhd 2008-01-07 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [189047] The fifo works now in lookahead mode. Reworte t...
 fifo_mf_inst.vhd 2007-12-18 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [7369d0] initial checkin
 make-doc.sh 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 phase_register.stp 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 phase_register.vhd 2008-04-02 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [2dbb71] phase coherent switching works on real hardware...
 phase_register_orig.vhd 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 profile_dds.stp 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 test_lvds_bus.stp 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII
 test_lvds_bus.vhd 2008-08-29 c704271@medus-c704.uibk.ac.at c704271@medus-c704.uibk.ac.at [9919b0] Added files so it should work now in quartusII

Read Me

AD9910 dds synthesizer firmware documentation
=============================================


Overview
--------

This is the documentation for the synthesizer board which is
meant to work with programmable pulse generator as designed by
Paul Pham

link:[http://pulse-sequencer.sf.net]

The features of the board are:

- Onboard Cyclone II FPGA for increased flexibility
- AD9910 DDS with 14Bit DAC and 1Gs/s clock
- AD9744 DAC and AD8367 VGA for pulse shaping
- 32Bit LVDS bus for high speed data transfer


This documentation is focused on the programming of the FPGA.
This is accomplished in the VHDL hardware description language.

This board is only supported by the sequencer2 python compiler/server.

The source code is spread over following files:
`------------------------`---------------------------
Filename                  Function
-----------------------------------------------------
dds_controller.vhd        top entity, opcode decoding
ddslib.vhd                configuration, opcode definition
dds_serial.vhd            parallel to serial decoding
fifo.vhd                  FIFO megafunction intance
phase_register.vhd        phase registers
-----------------------------------------------------

The VHDL files can be compiled with the free quartus II web edition which is
available at
link:[http://www.altera.com/]

Compilation
~~~~~~~~~~~
To compile the firmware open the dds_controller.qpf file in quartus II and press ctrl - L

To program the firmware on the FPGA open the Programmer in quartus II and select
active-serial-programming. Add the file dds_controller.pof for programming and press start.


Bus definition
~~~~~~~~~~~~~~
The control bits in the instruction word are:

`---------------------------------------`--------------------------
Function                                  Bus bits used
-------------------------------------------------------------------
opcode                                    (31:27)
data available                            (26)
address (not implemented)                 (25:22)
phase register wren / DRCTL               (21)
phase register set current /DHOLD         (20)
phase register address                    (16:19)
dds_drctl                                 (16)
dds_drhold                                (17)
dds_ramp_config                           (18)
data bus                                  (15:0)
--------------------------------------------------------------------

Write process timing:
~~~~~~~~~~~~~~~~~~~~~

A write process on the LVDS bus is specified with 3 clock cycles of the PCP-FPGA.
The length of one cycle is 10ns.

- Set the data bus , bits(15:0)
- Set opcode, dds address and other bits except data available bit(25)
- Set data available bit(25)

The data available bit should be unset after one clock cycle.

This is a conservative and hopefully save method to write data to the bus.

DDS interface
~~~~~~~~~~~~~

The ad9910 dds has internal registers which determine the mode of operation.
These registers have to be programmed over a serial SPI interface.
To speed up the data transfer from the PCP to the DDS the data is transmitted over
the parallel board to the FPGA on the DDS board. This data is then written into the
DDS via the serial interface.
Each configuration register has to be programmed at once. As the registers are up to
64Bits wide the data from the PCP is stored in a FIFO implemented the FPGA on the
DDS board.

A write cycle to  the DDS is accomplished as follows:

- The data is split in 16bit words
- This words are transmitted from the PCP to the FPGA
- The 8 bit address word of the register is transmitted
- The FIFO is read until it is empty


Testing the board:
------------------

Connecting the board
~~~~~~~~~~~~~~~~~~~~

- Connect 5V to the analog and digital power supply
- Connect 10V..12V to the analog 10V suply.
- Connect 100MHz to the T_DDS_FPGA connector
- Connect 800MHz to the connector P1
- Set the jumpers as shown in the image

INSERT IMAGE OF BOARD HERE

To test the functionality of the DDS board following procedure is recommended.

Test the Voltage regulators
~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Connect a single board to a power supply with an adjustable current limit.
- Set the current limit to about 10mA and the Voltage to 6V
- Turn up the curent limit. If the board draws more than 400mA there is most
likely a short circuit on the board.
- Check the desired output voltage with an oscilloscope/multimeter

 INSERT VOLTAGES AND IC NUMBERS HERE

Test the LVDS Bus
~~~~~~~~~~~~~~~~~

To test the functionality of the LVDS Bus a working sequencer-rev.C board and
a suitable breakout board is needed.

Furthermore a JTAG download cable and a quartusII installation is necessary

- Activate the test_lvds_bus.stp SignalTap file in quartusII
- Compile the VHDL source with quartusII
- Connect the JTAG cable to the JTAG board (J2)
- Program the FPGA (with JTAG, NOT active serial programming)
- Start ipython in the sequencer directory and execute following code:

-------------------------------------
from tests.test_hardware import *
t1 = HardwareTests(nonet=True)
t1.test_lvds_bus()
-------------------------------------

- Ensure that the bus values are correct.

INSERT SCREENSHOT

Another quick (but incomplete) test of the LVDS Bus can be performed by generating
DAC events with the sequencer and checking the output voltage of the DAC.

Test the DDS
~~~~~~~~~~~~
- Start ipython in the sequencer directory and execute following code:

-------------------------------------
from tests.test_hardware import *
t1 = HardwareTests(nonet=True)
t1.test_dds_simple()
-------------------------------------

- Test the output of the DDS.

INSERT DATA HERE

If these tests were succesfully you most probably have a working system.


Test phase coherent switching
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Use a fixed frequency source as reference
- Switch the DDS board to the same frequency with different phases.
- Check the pghase relation of the two signals with an RF-mixer


Programming guide
-------------------

Writing a register on the dds
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Split the data in 16bit words
- Write the data subsequentially into the FIFO with the fifo write insn
- Set the upper 8 bits of the data bus to the desired address
- Provide the dds address Opcode and the address data until the register is set

Load the phase register
~~~~~~~~~~~~~~~~~~~~~~~
- Split the frequency tuning word into two 16Bit words
- Write the lower word with wren=0 and set current=0 and the load phase opcode
- Write the upper word with wren=0 and set current=1 and the load phase opcode
- Set the phase register address bits
- Write load_wren_opcode and set_current=1 do not change data on pins 0:15

Phase coherent switching
~~~~~~~~~~~~~~~~~~~~~~~~
This is not properly implemented yet

- Set the dds frequency either by writing the register or the profile
- Provide the pulse phase opcode
- Wait 4 cycles
- Provide the dds update opcode

Set the DAC
~~~~~~~~~~~

- Set the data bus bits (13:0)
- Provide the dac amplitude opcode

Ramp Control
~~~~~~~~~~~~

Set the registers over the serial port. Control then the drhold and drhold pins of the DDS.

Preliminary Opcode specification
--------------------------------

Already implemented opcodes
~~~~~~~~~~~~~~~~~~~~~~~~~~~

`--------------`---------`-----------------------------------
Name            Opcode    Function
-------------------------------------------------------------
nop             0x0       Do nothing
dds_addr        0x1       Write content of FIFO to given DDS
fifo_wr         0x2       Write lower 16bits to FIFO
dds_profile     0x3       Set the DDS profile bits
dac_amplitude   0x7       Set the DAC for the VGA
load_phase      0xa       Load the phase register
pulse_phase     0xb       Write given phase register to DDS
fifo_reset      0x1f      Clear the FIFO
dds_update      0x4       Update the DDS or control ramp generator
-------------------------------------------------------------

Proposed opcodes
~~~~~~~~~~~~~~~~

`------------`-------------------------------
Name          Function
---------------------------------------------
dds_sweep     Start/Stop a DDS sweep
dds_ramp      Generate a DDS amplitude ramp
all_reset     Reset the FIFO and the DDS
---------------------------------------------

License
-------

(c) 2008 Philipp Schindler.

This work is published under the GNU Public License

The file phase_register.vhd is copyright by Paul Pham
and released under the BSD License.