I'm working on a project where PCB with ATMega328p will be submerged in resin. Of course I'll break out wires from ICSP pins to be able to change sketch using programmer later, but I would like to somehow isolate those wires from external world.
What I mean - I don't want situation when RST wire accidentally touches grounded frame and chip resets or MISO wire touches 12V and burns pin.
Then I need something like a relay on each line, and when I'll also connect power at additional pin it will close and I'll be ably to reprogramm chip.
But I need something smaller... much smaller. How about bidirectional mosfet switch consisting of 2 mosfets for each line? Normally gate connected to ground, but when I'll feed external 5V it will conduct. Will it work that way?