2015-10-30 06:56 AM
Hi
I am struggling to get the External Audio Clock Input (PC9 12.288MHZ) to be output by the SAI Master clock pin PF7. I have used STM32Cube to set it up and it all looks ok, but I can not get any output on the SAI Master Clock even if i try and use the internal PLL clock. I am trying to communicate with a SSM2604 codec, I can see the clock is correct on the SAI_SCK_B (PF8) and I get a pulse on SA1_FS_B but SA1_MCLK is Dead I am using SAI_B in master mode with Master Clock Out. Any Help, examples etc would be gratefully received Thanks John2015-10-30 08:49 AM
Post content of relevant SAI registers.
JW2015-11-02 05:08 AM
Part of my problem is that the debug SAI section is missing for STM32F427ZIT chip I have reported this to ST and they are implementing a fix. So I rebuilt my code for the STM32F429ZIT so I could then play with the MCKDIV reg Currently it is set to 0 and the NODIV value is also 0 (the actual value of SAI_BCR1 is 0x001120C0) which should put the SAI_CK_B clock out on MCLK_B but it doesn't but when I change MCKDIV to a non zero value ie 1 I get a MCLK_B but divided by the MCKDIV so 6.144MHZ but I want 12.288MHZ any ideas?
2015-11-02 08:26 AM
A bit More info
Ok This is strange
if I use this code hsai_BlockB1.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_96K; // SAI_AUDIO_FREQUENCY_MCKDIV; // then in debug manually set Mckdiv= 0x01 The MCLK Start working but if i set hsai_BlockB1.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_MCKDIV; hsai_BlockB1.Init.Mckdiv= 1; then the MCLK does not start regardless of what I change in debug but if Initialize Block B1 with hsai_BlockB1.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_96K; and then after HAL_SAI_Init(&hsai_BlockB1); set hsai_BlockB1.Instance->CR1=0x001120C1; MCLK works at half clock, I can not get it to run with Mckdiv set to zero But hsai->Init.AudioFrequency only appears to be used calculate MCKDIV but if it is not set to SAI_AUDIO_FREQUENCY_96K it does not work?2015-11-02 08:33 AM
Reg values - working at SAI_clock/2
________________ Attachments : RCC_Working.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0i6&d=%2Fa%2F0X0000000bd1%2Fm.x6hkz5z4.h9GBgUgLaMRgdR8k1SOVmSx97UsWNK.0&asPdf=falseSAI_Working.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0j3&d=%2Fa%2F0X0000000bcz%2F_JnghXci2NxYFCCgblHNvA69nzj.LKmmiBug1PZ5Lgw&asPdf=false