3 Replies Latest reply on Jul 18, 2018 3:28 AM by PradiptaB_11

    CY29421FLXI: Set any clock frequency via I2C

      I need example code how to program the CY29421FLXI to an arbitrary output frequency. This runs in an embedded system without the ClockWizard software for PC. Here's what I have in mind:


      void program_CY29421FLXI(double frequency)


          unsigned char DIVO_FS0;

          unsigned char DIVN_INT_FS0;

          unsigned char DIVO_MISC_FS0;

          unsigned char DIVN_FRAC0_FS0;

          unsigned char DIVN_FRAC1_FS0;

          unsigned char DIVN_FRAC2_FS0;


          // Calculate parameters

          // TODO...


          // Program via I2C

          i2c_write(0x55, 0x10, DIVO_FS0);

          i2c_write(0x55, 0x11, DIVN_INT_FS0);

          i2c_write(0x55, 0x12, DIVO_MISC_FS0);

          i2c_write(0x55, 0x13, DIVN_FRAC0_FS0);

          i2c_write(0x55, 0x14, DIVN_FRAC1_FS0);

          i2c_write(0x55, 0x15, DIVN_FRAC2_FS0);


          // Wait until large frequency change is active.



      It must be possible to change the output frequency an unlimited number of times without power-cycling.