Menu

Tree [871b21] master v0.35 /
 History

HTTPS access


File Date Author Commit
 .gitignore 2010-06-16 Paul Pham Paul Pham [391a30] Removed .vhd from gitignore, since we are not g...
 LICENSE 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 README 2010-07-07 Paul Pham Paul Pham [871b21] Added release notes and some modifications to P...
 TESTLOG 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 TODO 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 V0_1.qsf 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 V0_1_assignment_defaults.qdf 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 constant.vhd 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 constant_inst.vhd 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 dds-firmware-0.35-release-notes.txt 2010-07-07 Paul Pham Paul Pham [871b21] Added release notes and some modifications to P...
 dds_controller.dpf 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 dds_controller.qpf 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 dds_controller.qsf 2010-06-17 Paul Pham Paul Pham [4b31a1] Fixed sdio/sdo pins, added new VHDL modules.
 dds_controller.stp 2010-06-17 Paul Pham Paul Pham [e14b33] Last capture, the signals I was using to debug ...
 dds_controller.vhd 2010-06-17 Paul Pham Paul Pham [7a3f90] Removed all serial and fifo stuff, delegated to...
 dds_controller.vwf 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 dds_controller_assignment_defaults.qdf 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 dds_controller_sequencer.vwf 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 dds_controller_sequencer2.vwf 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 dds_controller_serial.vwf 2010-06-15 Paul Pham Paul Pham [a6af83] Added test for top-level dds_controller for jus...
 dds_serial_bus.dpf 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 dds_serial_bus.qpf 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 dds_serial_bus.qsf 2010-06-10 Paul Pham Paul Pham [884c6f] Updated dds_serial_bus with vwf test and rising...
 dds_serial_bus.vhd 2010-06-11 Paul Pham Paul Pham [91cc03] Fixed error of 9th clock cycle.
 dds_serial_bus.vwf 2010-06-11 Paul Pham Paul Pham [91cc03] Fixed error of 9th clock cycle.
 dds_serial_bus_assignment_defaults.qdf 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 dds_serial_decoder.qpf 2010-06-12 Paul Pham Paul Pham [55f737] Added dds_serial_decoder module.
 dds_serial_decoder.qsf 2010-06-17 Paul Pham Paul Pham [0be1c3] Added dds_stabilizer.vhd
 dds_serial_decoder.vhd 2010-06-17 Paul Pham Paul Pham [b6fe91] Changed STABLE_COUNT for stabilizers to 2.
 dds_serial_decoder.vwf 2010-06-17 Paul Pham Paul Pham [b6fe91] Changed STABLE_COUNT for stabilizers to 2.
 dds_serial_decoder_double.vwf 2010-06-17 Paul Pham Paul Pham [b6fe91] Changed STABLE_COUNT for stabilizers to 2.
 dds_serial_decoder_wait.vwf 2010-06-17 Paul Pham Paul Pham [b6fe91] Changed STABLE_COUNT for stabilizers to 2.
 dds_serial_fifo.qpf 2010-06-11 Paul Pham Paul Pham [f76397] Added files for DDS serial fifo wrapper module.
 dds_serial_fifo.qsf 2010-06-15 Paul Pham Paul Pham [403264] Check outputs in VWF file.
 dds_serial_fifo.vhd 2010-06-15 Paul Pham Paul Pham [9cc857] Fixed active_out
 dds_serial_fifo.vwf 2010-06-15 Paul Pham Paul Pham [9cc857] Fixed active_out
 dds_stabilizer.qpf 2010-06-16 Paul Pham Paul Pham [391a30] Removed .vhd from gitignore, since we are not g...
 dds_stabilizer.qsf 2010-06-17 Paul Pham Paul Pham [d03bd3] Added sampling and a stable_counter for unlatch...
 dds_stabilizer.vhd 2010-06-17 Paul Pham Paul Pham [d03bd3] Added sampling and a stable_counter for unlatch...
 dds_stabilizer.vwf 2010-06-17 Paul Pham Paul Pham [d03bd3] Added sampling and a stable_counter for unlatch...
 ddslib.vhd 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 dfs.ptf 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 dfs.vhd 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 fifo_mf.vhd 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 fifo_mf_inst.vhd 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 make-doc.sh 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 phase_register.stp 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 phase_register.vhd 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 phase_register_orig.vhd 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 profile_dds.stp 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 test_lvds_bus.stp 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.
 test_lvds_bus.vhd 2010-06-10 Paul Pham Paul Pham [c459f2] Added files copied wholesale from vhdl-9910.

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-programmer.org]

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 original vhdl-ad9910 source code was written by Philipp Schindler at
Innsbruck.
Additional modifications were added by Paul Pham to sample data multiple
times before latching out stable data to overcome bus sample errors at
UW Seattle.  

There is only one backward-incompatible change to Philipp's version, which is
that DDS register addresses now come first in the datastream, before the
register data. This requires the changes in the ppham branch of the
sequencer2 Python compiler in Mercurial.

The source code is spread over following files:
`------------------------`---------------------------
Filename                  Function
-----------------------------------------------------
dds_controller.vhd        top entity, opcode decoding
dds_serial_decoder.vhd    decoding and container for dds_serial_fifo
dds_serial_fifo.vhd       wrapper for fifo buffer and dds_serial_bus.
dds_serial_bus.vhd        low-level serial port operations for AD9910
dds_stabilizer.vhd        low-level data sampling to latch out stable levels.
ddslib.vhd                configuration, opcode definition
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.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.