I have a simple circuit just with LCD and MCU that writes text to it, something similar to this:
This picture is extremely simplified, the PIC has no unconnected pins in reality. This is the display I use: https://www.winstar.com.tw/products/character-lcd-display-module/dot-matrix-lcd.html
This display has few pins for power and contrast, then 2 control pins (RS and enable) and 8 data pins, but only 4 are used. I pulled the remaining pins down through resistors just to ensure some noise is not getting on them.
The problem I have is simple - whenever I start a 5V DC motor nearby - it doesn't even have to be part of this circuit, just being nearby to it is enough, the display gets full of garbage text. When motor is off, I can send initialization sequence from MCU to it again and it will reset and start showing normal text again. It's clearly picking up some EMI noise from the motor which causes this.
This happens virtually every single time I start that motor, it's really easy to reproduce.
Here is example picture of what happens after starting the motor:
I googled this problem and lots of people have it and usually the answer by some smart guru is "just add filtering capacitor" and that's it - but I am little too dumb for simple answer like this, frankly speaking, I am rather newbie to electronics - what is filtering capacitor exactly? what type and what capacity? I tried added 100nF ceramic (on pic it's probably marked as uF) between the Vdd and Vss of both PIC MCU and the display (because that's recommended in PIC datasheet), but it had 0 effect.
Can someone provide a simple circuit schematics with a filtering capacitor like this, or anything else that filters this noise and works? I was trying everything possible, even putting random capacitor of random values between all pins and ground and nothing helped at all.
This picture is extremely simplified, the PIC has no unconnected pins in reality
More pictures: