C code for configuring clock outputs for CY22801 IC via I2C?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
AdamWilsonCPI
Level 1
Level 1
5 replies posted 10 sign-ins 5 sign-ins

Hi all,

I'm writing an IIO driver in C for the Cypress CY22801, with communications via I2C.

However, setting the two available output clock channels generically will be difficult, as there are a lot of variables involved.

For example, I will have to calculate the values for PB, PO, Q, and DIVxN, and select the most suitable divider channel (1/2), and set the source controls for the clock outputs, for each clock output - each will affect the other one, also.

i.e. CLK_OUT_X = (2 * (pb + 4) + po) / (q + 2) / DIVxN * CLK_INPUT_FREQ

The CyClocksRT software generates all of this information automatically. Is the source code for this component of the software available, please? Or can a version of this be provided to aid our use of your products?

Many thanks,

Adam

0 Likes
1 Solution

Hi @AdamWilsonCPI ,

 

Unfortunately, we can not provide the source code as it is the company confidential thing.

Apologies for the inconvenience.

 

Thanks and Regards,

Nitin  

 

View solution in original post

0 Likes
5 Replies
Nitin_Gupta
Moderator
Moderator
Moderator
100 sign-ins 50 replies posted 25 solutions authored

Hi @AdamWilsonCPI 

You can download the latest version of CyberClocks here .

Thanks,

Nitin

0 Likes

Hi Nitin,

I already have the latest software installed, thank you.

I was wondering whether the source code is available for it, or at least a snippet for where all of the register configuration is done based on the selected output frequencies?

Many thanks,

Adam

0 Likes
Nitin_Gupta
Moderator
Moderator
Moderator
100 sign-ins 50 replies posted 25 solutions authored

Hi @AdamWilsonCPI 

Do you need memory map for this component?

Thanks,

Nitin

0 Likes

Hi Nitin,

I have the register map from the datasheet, thank you.

I want to configure this part dynamically at runtime via I2C. It should be possible to set an output setpoint frequency for CLKA and CLKC via SysFS on Linux, and the IIO driver I'm building should be able to setup the CY22801 as required.

This requires calculating the required values for all of the control registers based on the selected output clock frequencies, which is what the CyClocks software does to create a JDEC file.

If I had access to the related parts of the CyClocks source code, I would be able to do the same, but at runtime.

I could manually create a look-up table based on manually-generated output files from CyClocks, but this would take a long time, and the look-up table would be huge.

Many thanks,

Adam

0 Likes

Hi @AdamWilsonCPI ,

 

Unfortunately, we can not provide the source code as it is the company confidential thing.

Apologies for the inconvenience.

 

Thanks and Regards,

Nitin  

 

0 Likes