2017-09-17 11:00 PM
Hi all,
I'm trying to get work speaker output on my Discovery kit (STM32F469I-DISCO) but not succeed yet. I have connected
https://www.gme.cz/reproduktor-ls45n-3-r8-45mm-8ohm-1w
on pins 15 and 16 of extension connector CN12 and have used example 'Audio_playback_and_record' from 'STM32Cube_FW_F4_V1.16.0' repository, but cannot hear anything.I have changed configuration AUDIO_PLAYER_Init in waveplayer.c from OUTPUT_DEVICE_AUTO to OUTPUT_DEVICE_BOTH and OUTPUT_DEVICE_SPEAKER but still not working.
Headphones on 3.5 jack output works fine and when I connect speaker to the headphone's output, I can head sound, so speaker is OK.
I have looked briefly into source code in BSP and couldn't find any handling of PE3 which should be used for switching between Headphones and speaker output which looks strange. I have tried to find any existing solution or similar issue and found just
https://community.st.com/0D50X00009XkZevSAF
where WM8994 chip is used. But on STM32F469I kit is used CS43L22 chip.Do you have some suggestions for me?
Thanks for your help.
Tomas
#speaker #stm32f469i-disco #audio-playback #cs43l222017-09-19 06:47 AM
Hello,
Did you followed the different steps in the readme.txt for hardware configuration ?
Did you tested that speaker is working on another connector?
Kind Regards
Imen
2017-09-19 02:38 PM
Hello Imen,
I have read readme.txt from example folder and there is just mentioned JP4. But his jumper is not on STM32F469I-Disco. I read also Datasheet for Discovery kit and in chapter 6.5. Analog output is some mention about PE3. I suppose that this signal should be somehow handled in BSP analog driver.
I have also tested speaker on headphone output as I wrote and I could head some sound. So the speaker is fine (it's also brand new).
Documentation at the beginning of stm32469i_discovery_audio.c describe to call BSP_AUDIO_OUT_Init with argument OUTPUT_DEVICE_HEADPHONE1 or OUTPUT_DEVICE_HEADPHONE2 but later is described as OUTPUT_DEVICE_SPEAKER or OUTPUT_DEVICE_HEADPHONE. But I suppose that this is just not updated comment.
What I also don't understand is PE3 signal. Should I control it independently to BSP_Audio driver and should I Set it or Reset it for enabling speakers?
So any other idea? Does anybody tested this functionality?
Best regards
Tomas
2017-10-17 09:35 AM
Hello,
To get sound on the speaker, you should connect his loudspeaker (Left, Right and GND) to SPKR_OUTAN (pin 15 on CN12), SPKR_OUTAP(pin16 on CN12) and GND pin.SPKR/HP mapped on PE3 is an input Speaker/Headphone switch. It powers down the left and/or right channel of the speaker and/or headphone outputs as described in CS43L22 codec datasheet.To power down the channel of the speaker/headphone, you have to configure this pin as input and connect it either to GND or VDD.However, this pin is not exposed on the STM32F469I-Discovery, then it cannot be controlled. It?s a choice made to not power down speaker/headphone; so no BSP API is supporting this switch.
After checking, the ?Audio_playback_and_record? application worked fine with the sound on headphone and speaker (on SPKR_OUTAN and SPKR_OUTAP pins).
Kind Regards,
Imen.2017-10-29 03:04 PM
Hi Imen,
thank you for your advice. I was probably (and still I am) confused with a description in the datasheet of discovery kit:
Each of the two terminals of the external loudspeaker should be connected to pins 15 and 16 of CN2 respectively. Insure the terminals of the loudspeaker are not connected to the ground.
I supposed that I should connect my speaker to pins 15 and 16 of connector CN12. Now I have tested to connect my speaker to pin 16 and GND and it's working. From description is not much clear to me if I have to connect both pins 15 and 16 to any speaker. And note about 'not connecting terminals of the loudspeaker to the ground' means to not connect pin 15 directly to GND but through the speaker with impedance 8ohm?
Thank you for your clarification.
Tomas
2017-10-29 03:55 PM
The output has a significant DC component, i.e. you'd need to decouple it with a large capacitor if connected to ground.
The two outputs have the same DC level and they work in opposite phase, that's why you are supposed to connect the speaker between them.
JW