adafruit / Adafruit_Si5351_Library

Driver for Adafruit's Si5351 Clockgen Breakout
43 stars 30 forks source link

SI5351_MULTISYNTH_DIV_4 does not work correctly #15

Closed tttogasawara closed 2 years ago

tttogasawara commented 2 years ago

Hi,

I found that multisynth with div=4 does not work correctly. According to AN619, MSx_DIVBY4[1:0] must be 11b, when div=4. Please confirm.

Candidates for fixes are as follows:

after line 401,

  uint8_t DIVBY4=0;

after line 440,

    if ( div == 4 ){
      DIVBY4=0b1100;
    }

line 474,

  sendBuffer[3] = ((P1 & 0x30000) >> 16) | lastRdivValue[output]|DIVBY4;

Regards,

dhalbert commented 2 years ago

Is the combination of these a fix? Are you able to submit a pull request? That would be great. Thank you.

tttogasawara commented 2 years ago

Thank you for your response. I have sent a pull request (#17). Please confirm.