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

Bugs when setting DAC5687 registers #8

Open
markasoftware opened this issue Jan 10, 2022 · 0 comments
Open

Bugs when setting DAC5687 registers #8

markasoftware opened this issue Jan 10, 2022 · 0 comments
Assignees

Comments

@markasoftware
Copy link
Member

Took a look at the datasheet today.

(settings->config_0.pll_kv << 5) | (settings->config_0.fir_interp << 3) |
(settings->config_0.inv_pll_lock << 2) | (settings->config_0.fifo_bypass);

Wrong bitshifts for interp and pll_lock, should be 2 and 1 respectively.

txBuf[17] = (settings->dac_a_off & 0xF00) >> 8;
txBuf[18] = (settings->dac_b_off & 0xF00) >> 8;

Bitshift should be by 4, not 8.

txBuf[22] = ((settings->qmc_phase & 0x300) >> 2) | ((settings->qmc_a_gain & 0x500) >> 5) |
((settings->qmc_b_gain & 0x500) >> 8);

Should be 0x700 instead of 0x500, because 0x500=0b101.

txBuf[25] = ((settings->dac_a_gain & 0x800) >> 4) | ((settings->dac_b_gain & 0x800) >> 8);

Should be 0xF00 instead of 0x800, because 0x800=0b1000 0000 0000.

txBuf[27] = ((settings->atest & 0x8) << 4) | (settings->phstr_del & 0x2);

Should be 0xF, not 0x8, and 0x3 instead of 0x2, and phstr_del needs to be bitshifted left by 1.

@sailedeer sailedeer self-assigned this Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants