2013-08-09 02:41 PM
Hi,
I am working on a simple custom HW design based on the STM32L SoC.The STM32L is connected to several LEDs as well as a microphone along with other external devices like batteries, switches etc .. The firmware is written from scratch that collects the sound through the ADC via the DMA and into a pre-defined local buffer of the memory. At the same time the LEDs are programmed to be ON or OFF with a predefined duty cycle.Everything seems to work well except that I get noise spikes through the sound samples from the microphone when the duty cycle is anything but 0% or 100%.The noise seems to be related to LEDs switching from ON to OFF or vice versa. Whether this is through the PWM or manually turning the LEDs on or OFF by firmware. Every time LEDs switch I get spikes showing in the background noise samples through the microphone.I have 8 LEDs in total and I turned half of the them off and the spike amplitude reduces as the number of LEDs are turned off. I really like to get a clean sound through the microphone but each time LEDs come On or OFF I get these annoying spikes.Any ideas as to why this is happening ?Happy to share schematics if you think you can help.Many ThanksRaminee #stm32l2013-08-10 05:20 AM
I am working on a simple custom HW design
The noise seems to be related to LEDs switching from ON to OFF or vice versa.
Any ideas as to why this is happening ?
do you have a solid ground plane? do you have enough decoupling caps? are the traces to those less than 5mm?Happy to share schematics if you think you can help.
schematics will not help, this is a layout problem Erik
2013-08-10 09:22 AM
Since my posting we found the problem to be with the 3.3v rail.
When the LEDs turn ON the power source (3.3v in this case) dips slightly.The audio amplifier is on the same 3.3v voltage rail and when the voltage dips the amplifier causes the spike in the signal that is then fed to the ADC of the SoC.R.2013-08-10 10:10 AM
While you fault the 3V3 rail - other areas bear exploration:
a) Led is human - not machine read/recognized - thus avoidance of ''common toggling (multiple Leds) will reduce noise spikes. You'll never note the slight delay. b) Dialing in ''slew-rate'' will further reduce. (even when 3V3 rail is proper) c) Modern Leds (decent ones) illuminate brightly (widely too - if properly chosen) at reduced currents when compared to older/lesser devices d) Ground plane (as other poster suggested) is important - and your circuit path to the microphone should avoid higher current and/or any switching signals/traces/components. Suggestions here should benefit - flow into all of your low-level, analog signal handling...2014-08-07 10:07 AM
In Reference to your noise problem you must have a shield wire around your audio wire in order to catch all noise from both led lights and audio output also must have your ground from audio and led lights grounded in different locations this will stop all your problems hope i was of help i know cause i have a product and had the same problems now they are resolved.
2014-08-08 01:34 AM
Hi
''I am working on a simple custom HW design based on the STM32L SoC.'' Wow, I did not know they did that. Depending on the STM32 core that you are using, check if the ADC has a Vref input. If it does, use a different supply (different voltage rail/regulator - call this 'analogue supply'). This may help decouple the digital switching noise from the analogue.