cancel
Showing results for 
Search instead for 
Did you mean: 

i2s want to run my project with stm32nucleo and pcm4201 mic ic... not working PC6= I2S2_MCK

erkan_34_TR_
Associate II

?

4 REPLIES 4

What's the question? You don't have clock on I2S2_MCK? And are there clocks on the remaining clock outputs? I'm not going to check your code, but read out the relevant GPIO and SPI/I2S registers and check their content.

JW

erkan_34_TR_
Associate II

GPIO_InitTypeDefStruct.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_6;

GPIO_InitTypeDefStruct.GPIO_Mode = GPIO_Mode_AF;

    GPIO_InitTypeDefStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;

GPIO_InitTypeDefStruct.GPIO_Speed = GPIO_Speed_50MHz;   // GPIO_Low_Speed  

GPIO_InitTypeDefStruct.GPIO_OType = GPIO_OType_PP;

    GPIO_AF_SPI2;

GPIO_Init(GPIOC, &GPIO_InitTypeDefStruct);

     

    RCC_I2SCLKConfig(RCC_I2S2CLKSource_PLLI2S); 

    RCC_PLLI2SCmd(ENABLE); 

    RCC_GetFlagStatus(RCC_FLAG_PLLI2SRDY);

    while(RCC_GetFlagStatus(RCC_FLAG_PLLI2SRDY) == RESET);

but not out clk signal

erkan_34_TR_
Associate II

 /* Enable PLL Ready interrupt */

    RCC_ITConfig(RCC_IT_PLLI2SRDY, ENABLE);

    RCC_ClearITPendingBit(RCC_IT_PLLI2SRDY);

    RCC_GetFlagStatus(RCC_FLAG_PLLI2SRDY);

    RCC_I2SCLKConfig(RCC_I2S2CLKSource_PLLI2S); 

    RCC_PLLI2SCmd(ENABLE);

I don't use SPL. But why don't you read out the registers content and check them.

Btw. this line is suspicious:

   GPIO_AF_SPI2;

JW