2013-04-16 04:09 AM
Hi!
I have a big problem and need a lot of help. First of all I will try to explain the global situation and after that I will ask you for some questions. I am working in a project. I have to make a full-duplex audio communication between a PC with Linux and the evaluation board ''Keil MCBSTM32F400''. They have to be connected throw Ethernet. The part of the PC is finished and now I have to implement the part of the evaluation board. The board has to take UDP packets (with PCM audio that was sended from the PC), playback the audio throw the speakers, capture audio throw the built-in MEMS microphone and send the captured audio within UDP packets. My first step is to make work the speaker (reading a PCM audio file stored in the board memory). I have looked for examples of this board but there is any audio example. I was trying to use the examples for the ''STM32 Discovery'' board and ''STM3240G Eval'' but the problem is that the audio codec is not the same. My board has a CS42L52 audio codec while the other two boards have a CS43L22 auido codec. Both audio codecs are very similar. I was trying to make some changes to let the examples work with my board but I have a problem with the reset function of the codec. In the example for the STM32 Discovery board, the reset is made using a GPIO pin: /* Audio Reset Pin definition */ #define AUDIO_RESET_GPIO_CLK RCC_AHB1Periph_GPIOD #define AUDIO_RESET_PIN GPIO_Pin_4 #define AUDIO_RESET_GPIO GPIOD In the example for the STM3240G Eval board, the reset function is made using the IO expander and I am not sure what does it means and if I have (or may have) that in my board: #include ''stm324xg_eval_ioe.h'' /* IOExpander driver is included in order to allow CS43L22 codec reset pin managment on the evaluation board */ Can someone help me? I am very frustrated. I have asked to the ARM support but they only have answered me that there is no GPIO pin dedicated to reset the audio codec and that maybe I have to use the I2C to make the reset... but how??? Thanks in advance!2013-04-19 03:58 AM
2013-04-19 04:40 AM
''What does the CODEC datasheet say?''
4.9 Recommended Power-up Sequence
1. Hold RESET low until the power supplies are stable.
2. Bring RESET high.
3. The default state of the PDN bit is ‘1’b. Load the desired register settings while keeping the PDN bit set to ‘1’b.
4. Load the required initialization settings listed in
Section 4.11
.
5. Start MCLK to the appropriate frequency, as discussed in
Section 4.6
.6. Set the PDN bit to ‘0’b.
7. Apply LRCK, SCLK, and SDIN for normal operation to begin.
8. Bring RESET low if the analog or digital supplies drop below the recommended operating condition to prevent power glitch related issues.
I don´t know how to hold RESET low and to bring RESET high because in the datasheet the RESET pin of the audio codec is taged as /RST, which is the same tag as, for example, the reset button of the board and every peripherals with a RESET pin. How can I change the value of /RST, but only to reset the audio?
2013-04-19 05:04 AM
''in the datasheet (sic?) the RESET pin of the audio codec is taged as /RST''
Do you mean, ''in the Keil MCBSTM32F400 board schematic...''?
2013-04-19 05:08 AM
Yes, I mean in the schematics of the MCBSTM32F400 board
2013-04-19 05:24 AM
Look at the description of the STM32F4's NRST pin in the RM0090 Reference Manual:
2013-05-07 04:13 AM
Ok, now I could make the audio playback work (thanks a lot to Andreas Finkelmeyer) and also the ethernet. I would like to ''join'' both to reproduce the audio frames that comes through the Ethernet using UDP packets. I have tryed to do it using the DMA and also writing each audio packets directly when they arrives to the board, but there isn´t any sound.
What should I know to make it work? Which are the important things that I have to be in mind?