2024-04-05 05:11 AM
I am using two STM32F405's to read a switch and have some diagnostics.
I interface this to an analog input on one MCU and a digital input (no pull up/down) on another MCU.
However, I have cross-talk with the neighboring analog channels and more severe, also disturbances when doing radiated immunity tests (100 V/m).
The circuit is like shown (actually there are several identical interface circuits):
The ADC is running continuous scan mode, 28 cycles, 10 MHz.
It seems that decreasing capacitor at AIN (C3) to e.g. 100 pF improves the immunity. So far I have only focused on the filter function R2, C3/C4, but is it more important to have small capacitance close to the MCU?
When reading datasheet and application notes they say capacitor should be in pico farad range.
Datasheet states a maximum value for R2 to be less then 65 kohm (calculated from equation 1). Would the performance EMC and cross-talk wise be improved by using a lower resistance value?
I there a way to improve cross-talk by delaying time from setting internal MCU multiplexer to start of conversion?
2024-04-05 06:24 AM
It is best to put the RC filters as close as possible to the MCU pins and one for each MCU. If there are high peaks in the interference, it is advisable to block the analog channel immediately at the PCB input with a capacitor and Schottky diodes to VSS and VDD. It also depends on the spectrum of the interfering signal. If the connection is over a longer distance and the interference is high, I recommend converting the sensors analog signal to some digital signal (PWM, RS485 ...) near the sensor place and use optical separated line for data transmision.
2024-04-05 06:30 AM
Are you trying to debounce the switch? For a purely digital this is easily done well in hardware.
https://www.ganssle.com/debouncing.htm?_sm_au_=iVVWF4fN4r0N3ctcJ6F3jKH7c2fV2
https://www.ganssle.com/debouncing-pt2.htm
HTH.
CRS
2024-04-05 10:06 AM
Hello FinnF,
Thank you for contacting STMicroelectronics.
Your post was escalated to ST Online Support Team for additional assistance.
Kind Regards,
Christian
ST Support