2024-05-22 08:02 AM
Hi,
I have an application where I am trying to read some pulsed inputs from an optocoupler (for isolation) which consist of pulled high inputs on the STM32 MCU, the problem is it keeps crashing when connected directly to the optocouplers randomly when they change state? When I connect the digital inputs directly to the ground rail (0V) or float the input pins the software works fine and doesn't crash at all?
Is there something interfering or causing the pulled high inputs to cause this issue? Is it best to use external pull up resistors or a series resistor? Thanks
2024-05-22 08:06 AM
Show at least a simplified schematics of your optocoup[ler setup. What do you mean by "crash"? How is your power scheme?
2024-05-22 08:20 AM
2024-05-22 08:44 AM - edited 2024-05-22 08:45 AM
Hi,
1. the opto will not survive your abuse . At least not long time. (need back diode ! or AC coupler.)
2. you need a cap input-pin ---cap--- gnd, to avoid EMI /spikes coupled to the cpu .
3. a pullup might be a good idea, together with a cap . (Do a simulation, to see what happens.)
2024-05-29 09:53 AM
This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.