Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test AD9910 DRG to extend frequency resolution #210

Closed
jordens opened this issue May 30, 2017 · 13 comments
Closed

Test AD9910 DRG to extend frequency resolution #210

jordens opened this issue May 30, 2017 · 13 comments
Assignees
Milestone

Comments

@jordens
Copy link
Member

jordens commented May 30, 2017

We'd like to use the digital ramp generator in the AD9910 to extend the frequency resolution.

But apparently the DRG accumulator doesn't wrap around (https://ez.analog.com/thread/95552).

The other option I see is to use the DRG to do phase ramps in continuous no-dwell mode with both no-dwell bits set and DRG limits at max/min respectively. To implement a frequency offset fSYSCLK2^(N-32)/(4P), one would then choose a power of two as the DRG step size (2^N) and P for the DRG ramp interval counter such that the DRG accumulator exactly reaches the upper limit (2 pi \equiv 0) after 2^(32-N) DRG steps, and correctly resets to zero phase offset. That is then equivalent to wraping around.

Originally from #195 (comment)

@hartytp could you test this mode of operation (instead of the one suggested in #195)?

@hartytp
Copy link
Collaborator

hartytp commented May 30, 2017

So, how about:

Clock: 1GHz
FTW: 0x1FFFFFC0 (124.9999851MHz)
DRG Sweep Phase0: 0x0000 (0deg)
DRG Sweep 1Phase1: 0xFFFF (359.995deg)
DRG Rising/Falling Step Size: 0x0100 (1.406deg)
DRG Step interval: 0x0001 (0.0040us)
DRG no dwellhigh/low set

@hartytp
Copy link
Collaborator

hartytp commented May 31, 2017

ad9910_regs

20170531_091304

@jordens
Copy link
Member Author

jordens commented May 31, 2017

That will do a trangular ramp AFAICT. For a sawtooth phase, the negative step size needs to be (1<<32) - P where P is the positive step size.

@hartytp
Copy link
Collaborator

hartytp commented May 31, 2017

You mean:
ad9910_regs

@jordens
Copy link
Member Author

jordens commented May 31, 2017

  • DRG limits (0x0B): FF FF FF FF 00 00 00 00 (359.99999991618097 deg, 0 deg)
  • DRG step (0x0C): FF FF FF 00 00 00 01 00 (359.9999785423279 deg, 2.1457672119140625e-05 deg)
  • DRG ramp rate (0x0D): 00 01 00 01 (4 ns, 4 ns)
  • ASF0/POW0/FTW0 : 3F FF 00 00 1F FF FF C0, (124999985.0988388 Hz)
  • both no-dwell bits, DRG enable, DRG target phase set in CFR2 (0x01)

@hartytp
Copy link
Collaborator

hartytp commented May 31, 2017

DRG limits (0x0B): FF FF FF FF 00 00 00 00

AFAICT, in DRG phase ramps one can only set the upper 16 bits of the limits. Thus, we can set FF FF 00 00 00 00 00 00, but not FF FF FF FF 00 00 00 00. (That would only be possible for frequency sweeps).

@jordens
Copy link
Member Author

jordens commented May 31, 2017

Or bigger steps:

  • DRG step (0x0C): FF 80 00 00 00 80 00 00 (359.296875 deg, 0.703125 deg)
  • DRG ramp rate (0x0D): 80 00 80 00 (0.131072 ms, 0.131072 ms)

@jordens
Copy link
Member Author

jordens commented May 31, 2017

Pretty sure that's only a limitation of that evaluation software, not of the chip.

The phase and amplitude step size equations yield the average
step size. Although the step size accumulates with 32-bit precision,
the phase or amplitude destination exhibits only 16 or 14 bits,
respectively. Therefore, at the destination, the actual phase or
amplitude step is the accumulated 32-bit value truncated to 16
or 14 bits, respectively

@jordens
Copy link
Member Author

jordens commented May 31, 2017

Just rail 0x0B to whatever max/min the software allows. That will be a small error but will not invalidate the test.

  • 0x0B: FF FF 00 00 00 00 00 00
  • 0x0C: FF 80 00 00 00 80 00 00
  • 0x0D: 80 00 80 00

@hartytp
Copy link
Collaborator

hartytp commented May 31, 2017

From the DRG overview section in the AD9910 data sheet. Looks like it's a limitation of the DDS itself, not the software.

The output of the DRG is a 32-bit unsigned data bus that can be
routed to any one of the three DDS signal control parameters, as
controlled by the two digital ramp destination bits in Control
Function Register 2 according to Table 11. The 32-bit output
bus is MSB-aligned with the 32-bit frequency parameter, the
16-bit phase parameter, or the 14-bit amplitude parameter, as
defined by the destination bits. When the destination is phase
or amplitude, the unused LSBs are ignored.

Edit: AFICT, the DRG effectively modulates the POW, rather than the accumulator...

@jordens
Copy link
Member Author

jordens commented May 31, 2017

That datasheet description is consistent with mine above. And you can see from the register dump that the DRG is always 32 bits wide.
The DRG is an accumulator that can modulate the POW. And a triangular ramp on the POW is a frequency offset.
What is the result with the parameters above?

@hartytp
Copy link
Collaborator

hartytp commented Jun 1, 2017

ad9910_regs
20170601_140019

Beat note with 125MHz synth, using mixer + LPF.

@jordens
Copy link
Member Author

jordens commented Jun 1, 2017

Using the DRG in double no-dwell mode to add a sawtooth phase ramp works.

@jordens jordens closed this as completed Jun 1, 2017
This was referenced Jun 1, 2017
@jordens jordens modified the milestone: Urukul 0.1 Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants