2015-08-10 10:59 PM
Hey everybody :) The STM32F4 disco has an external audio DAC witch is still a little hard to grasp for me, I was hoping anybody of You know any good tutorials, where it would explain how to get a sampling frequency You want.
I managed to start it and added the DMA to move data from an array (32 samples of sine) in my program to the DAC. The only problem I have is I can't get the sine to be a specific frequency. I need at least 16kHz sampling frequency so the sine should be 2kHz at the audio output. What I get is 2.93kHz which is kinda random. I have 12MHz on PC7, which should be enough for the CS43L22.2015-08-10 11:26 PM
I forgot to mention that I get the 12MHz only if I insert this line:
''SPI3->I2SPR = (uint16_t)((uint16_t)0x04 | (uint16_t)(0 | (uint16_t)I2S_InitStruct.I2S_MCLKOutput));'' after the PLLI2Scmd(ENABLE); Since the I2S clock is set with 192 divided by 2, I get 96, the if I insert 4 into the i2S divider I get 12MHz. And I don't know if this is the correct way to do this.2015-08-13 02:38 PM
Otherwise no mater what I do the PC7 pin is always 8MHz and according to the CS43L22 datasheet, that can not be. Because it need at least 12MHz. :D
2015-08-16 01:39 PM
Ok, I figured out the clock :) everything looks fine on the DAC side :) My goal was to take samples from MEMS mic and send the to DAC :) But so far I get nonsense on the output (you can see it in the attached file). I am trying to do everything through the interrupts. One is doing the filtering and the conversation from PDM to PCM and the other one is sending samples one by one to the DAC :)
They are enabled like this: -SPI_I2S_ITConfig(SPI2, SPI_I2S_IT_RXNE, ENABLE); (interrupt for MEMS mic - if not empty do...convesation) -SPI_I2S_ITConfig(SPI3, SPI_I2S_IT_TXE, ENABLE); (interrupt for the AUDIO DAC CS43L22, if empty do...send) again if you know any good links to read, I would really appreciate it. I found all the reference manuals, but they are of no help :) ________________ Attachments : IMG_20150816_233442.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzoS&d=%2Fa%2F0X0000000bQ7%2FwhewOeHt86OaMFhklVno2Pjygyw_TJGvzKjAmRZ8HhA&asPdf=false