I have a board with PIC186722. It works OK, but when I switch on some 220V lamps near by sometimes it freezes.
I tought I should put on an LC filter to eliminate these spikes, but will this help?
I am using the USB's 5V (and external 5V if it's not connected to the PC) and it's regulated to 3.3V with LT1763 (I tried with MC33269D-3.3 too).
Could anyone tell me how to calculate the size of the L and C?
Is there a common LC filter as the 100nF ceramic filter capacitor which should be used in a PSU for an MCU?
This sounds like EMI & RFI, not necessarily power line spikes, so you might need more than an LC filter.
I would start there first though, use a common mode choke, and some ceramic capacitors, nothing is critical, a few milihenrys as a filter, with tens of uF.
A ferrite bead with a few turns as a lossy RF choke, with a common 100nF cap, etc.
Yeah, but this sounds more like an EMI issue, I don't know how to fix that, other than to shield the uProc, and harden all the lines entering the board.
You should have buffers on all the I/O lines, this will also prevent shorts from frying the PIC.