ADRV9009 + ZC706: DDS tones

Hello,everyone!

I'm puzzled about the tones about ADRV9009:

Please see function axi_dac_init() in axi_dac_core.c:

int32_t axi_dac_init(struct axi_dac **dac_core,
		     const struct axi_dac_init *init)
{
	struct axi_dac *dac;
	uint32_t reg_data;
	uint32_t freq;
	uint32_t ratio;
	uint8_t ch;

	dac = (struct axi_dac *)malloc(sizeof(*dac));
	if (!dac)
		return FAILURE;

	dac->name = init->name;
	dac->base = init->base;
	dac->num_channels = init->num_channels;

	axi_dac_write(dac, AXI_DAC_REG_RSTN, 0);
	axi_dac_write(dac, AXI_DAC_REG_RSTN,
		      AXI_DAC_MMCM_RSTN | AXI_DAC_RSTN);

	mdelay(100);

	axi_dac_read(dac, AXI_DAC_REG_STATUS, &reg_data);
	if(reg_data == 0x0) {
		printf("%s: Status errors\n", dac->name);
		goto error;
	}

	axi_dac_write(dac, AXI_DAC_REG_RATECNTRL, AXI_DAC_RATE(3));

	axi_dac_read(dac, AXI_DAC_REG_CLK_FREQ, &freq);
	axi_dac_read(dac, AXI_DAC_REG_CLK_RATIO, &ratio);
	dac->clock_hz = freq * ratio;
	dac->clock_hz = (dac->clock_hz * 390625) >> 8;

	for (ch = 0; ch < dac->num_channels; ch++) {
		axi_dac_dds_set_frequency(dac, ((ch*2)+0), 3*1000*1000);
		axi_dac_dds_set_frequency(dac, ((ch*2)+1), 3*1000*1000);
		axi_dac_dds_set_phase(dac, ((ch*2)+0), (ch % 2) ? 0 : 90000);
		axi_dac_dds_set_phase(dac, ((ch*2)+1), (ch % 2) ? 0 : 90000);
		axi_dac_dds_set_scale(dac, ((ch*2)+0), 50*1000);
		axi_dac_dds_set_scale(dac, ((ch*2)+1), 50*1000);
		axi_dac_write(dac, AXI_DAC_REG_DATA_SELECT((ch*2)+0), 0);
		axi_dac_write(dac, AXI_DAC_REG_DATA_SELECT((ch*2)+1), 0);
	}
	axi_dac_write(dac, AXI_DAC_REG_SYNC_CONTROL, AXI_DAC_SYNC);

	printf("%s: Successfully initialized (%"PRIu64" Hz)\n",
	       dac->name, dac->clock_hz);

	*dac_core = dac;

	return SUCCESS;
error:
	free(dac);

	return FAILURE;
}

In headless.c,dac->num_channels is set  to 4:

struct axi_dac_init tx_dac_init = {
		"tx_dac",
		TX_CORE_BASEADDR,
		4,
	};

Does it means all of the four channels generate two tones,and all of  the two tonefrequency is 3MHz?

What's the relationship between the DDS channels and the Tx channels(Tx1 and Tx2)?

Thanks.

Parents Reply Children
No Data