RobTillaart / AD985X

Arduino library for AD9850 and AD9851 function generators.
MIT License
12 stars 2 forks source link

`AD9851::setRefClockHigh()` doesn't work #33

Closed wh201906 closed 8 months ago

wh201906 commented 8 months ago

To reproduce this bug:

ad9851.begin();
ad9851.powerUp();
ad9851.setAutoRefClock(false);
ad9851.setRefClockHigh();
ad9851.setFrequency(1000);

The output frequency is not 1kHz.


This can be fixed by #32

RobTillaart commented 8 months ago

@wh201906 See comments in PR #32

RobTillaart commented 8 months ago

@wh201906 Created develop branch and a PR. added a uint8_t _factoryMask, which is set in the constructor of both the AD9850/51 This mask is then used as in your PR #32

RobTillaart commented 8 months ago

@wh201906 if time permits, could you test the develop branch. In my test it seems to work - tested the value of the mask depending on type - as I have no hardware setup nearby. Will merge later today.

wh201906 commented 8 months ago

I only have an AD9851 so I can only test that

RobTillaart commented 8 months ago

That would be sufficient as for the AD9850 there is nothing changed. When I create 2 objects and print their mask I get the right mask. So I'm confident it works, but as always proof with real hardware is proof.

wh201906 commented 8 months ago

@RobTillaart I‘ve tested the code in the develop branch. It's working on AD9851.

I tried AD9851::setRefClockLow(); and AD9851::setRefClockHigh();, both have the right output frequency. Thanks!

RobTillaart commented 8 months ago

Will merge and release 0.7.0 right away. (done)