CX3, generating MCLK freq to a sensor

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

cross mob
AkCh_1378701
Level 3
Level 3
First like given

Hi sir,

Is there any sample code available for generating MCLK freq to a sensor?

i understood that MCLK just for test, and will not use that for mass production.

thank you

0 Likes
1 Solution
abhinavg_21
Moderator
Moderator
Moderator
50 likes received 25 likes received 10 likes received

Hi Akeem,

There is no feature to configure MCLK from CX3 config tool but you can generate MCLK by changing generated CyU3PMipicsiCfg_t structure in mipicsi.c file. Following changes need to done:

CyU3PMipicsiCfg_t cfgUvc5Mp15NoMclk =  {

    CY_U3P_CSI_DF_YUV422_8_2,

    2,

    1,

    64,

    CY_U3P_CSI_PLL_FRS_500_1000M,

    CY_U3P_CSI_PLL_CLK_DIV_8,

    CY_U3P_CSI_PLL_CLK_DIV_8,

    0xFFFF,            // Change this from zero to non zero value  MSB act as High counter & LSB act as Low counter. Set Duty Cycle using it.

    CY_U3P_CSI_PLL_CLK_DIV_8, /// Set the MCLK frequency using this divider value.

    2592,

    0x01

};

Take any CX3 default example make above 2 changes in the mipicsicfg structure and it will generate MCLK on G3 pin of CX3.

Thanks & Regards

Abhinav Garg

View solution in original post

2 Replies
abhinavg_21
Moderator
Moderator
Moderator
50 likes received 25 likes received 10 likes received

Hi Akeem,

There is no feature to configure MCLK from CX3 config tool but you can generate MCLK by changing generated CyU3PMipicsiCfg_t structure in mipicsi.c file. Following changes need to done:

CyU3PMipicsiCfg_t cfgUvc5Mp15NoMclk =  {

    CY_U3P_CSI_DF_YUV422_8_2,

    2,

    1,

    64,

    CY_U3P_CSI_PLL_FRS_500_1000M,

    CY_U3P_CSI_PLL_CLK_DIV_8,

    CY_U3P_CSI_PLL_CLK_DIV_8,

    0xFFFF,            // Change this from zero to non zero value  MSB act as High counter & LSB act as Low counter. Set Duty Cycle using it.

    CY_U3P_CSI_PLL_CLK_DIV_8, /// Set the MCLK frequency using this divider value.

    2592,

    0x01

};

Take any CX3 default example make above 2 changes in the mipicsicfg structure and it will generate MCLK on G3 pin of CX3.

Thanks & Regards

Abhinav Garg

Really nice!

it works.. super cool!

0 Likes