Isolating 328p ICSP pins from external world but beeing able to burn sketches

Hi,

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?

It is not exactly clear what you want to protect the circuit from. For example, it must at least have a power wire and ground running to it which could equally, in a fault situation destroy the device (direct lightning strike etc.). But anyway, if in addition, you want to protect MISO, MOSI, CLK, RESET, you could use reed switches. A magnet, located correctly, could activate these connections for programming.

Sorry, I haven't made it clear.

I'm doing it on PCB, and by broken out wires i mean just pins that i can connect wires to. I need isolation between that pins and chip pins.

Thats 48mm x 52mm PCB almost full of electronics, thats why I don't want to use relay. Module is powered from different wires, so I need to only "isolate" 4 pins - MISO, MOSI, CLK and RESET + 1 pin for "deisolating".

Why not cover the pins by a dummy connector, that can be removed for attaching a programmer.

It will be covered, but if it will fall off there's gonna be a problem.

I'm not looking for a way to cover port - I'm looking for some kind of electronic circuit that will work like relay on ICSP lines, so I will be able to turn on and off communication with one external pin (FETs gate or something else). I need it to be as small as possible.

You may also get overheating problems if it’s encapsulated .

Why do you want to do this ?

Choose a setup that can be accessed and programmed wirelessly, by BT or similar.

Kamool: 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.

Design the resin block so that the connections are recessed sockets, not pins, in the block. That way there is nothing to bend. That is make a socket in the resin.

You could even use a ready made socket that you then cast into the resin block with the 328 and pcb.

What is the environment that you are protecting the PCB from?

Tom... :)

hammy: You may also get overheating problems if it’s encapsulated .

Why do you want to do this ?

I'm not getting overheating problem. Already got working thing, but I'd like to add reprogramming capability to that, so I would be able to apply my future updates (to make things work better than they are working now)

DrDiettrich: Choose a setup that can be accessed and programmed wirelessly, by BT or similar.

I won't change everything just to make reprogramming possible, that's why i just want to add 5 pins, since it wond change much layout and size of my PCB.

TomGeorge: What is the environment that you are protecting the PCB from?

Motorcycle... close to battery, a lot of sharp frame edges...

Kamool: It will be covered, but if it will fall off there's gonna be a problem.

Well screw it on then! Use a gasket if required. :roll_eyes:

You can get multi-pin connectors with waterproof covers.

Kamool: It will be covered, but if it will fall off there's gonna be a problem.

Never heard of duct tape? Cable ties work wonders, too.

Yes, that would mechanically isolate that, but I still would like to have some kind of isolating circuit on board.

Hi,

Motorcycle… close to battery, a lot of sharp frame edges…

I think you are over thinking the situation.
Use an IP65 box with a screw down removable lid.
Wrap the box in high density foam.

Look up sealed ABS or sealed polycarbonate cases.
Use a cable gland to provide your wire entry points.
Open the case to program.
You can still pot the project to provide physical protection from vibration, just have the program socket inside the case.

Tom… :slight_smile:

Lets forget about my project... Just help me with making such circuit that will cut communication on ICSP lines, maybe for future projects.

Use a 74HC126 tri-state buffer. Remember that MOSI goes the opposite direction.

Use the Vcc of the ISP to enable the chip; when programming you have to power it the regular way, don't connect the Vcc of the ISP to that of the board's normal power supply. Add a pull-down resistor to the EN lines. You will have to connect GND of the ISP to the board of course, but that's safe unless you have powered wires floating around in which there are worse issues with that bike.

wvmarle:
Use a 74HC126 tri-state buffer. Remember that MOSI goes the opposite direction.

Use the Vcc of the ISP to enable the chip; when programming you have to power it the regular way, don’t connect the Vcc of the ISP to that of the board’s normal power supply. Add a pull-down resistor to the EN lines. You will have to connect GND of the ISP to the board of course, but that’s safe unless you have powered wires floating around in which there are worse issues with that bike.

Then I should make something like in attachment?

Didn’t You make a mistake? Souldn’t MISO by opposite direction?

Master(Programmer) - > Slave (ATMega328p)

External Pin MOSI - > ATMega MOSI

External Pin MISO < - ATMega MISO

External Pin RST - > ATMega RST

External Pin SCK - > ATMega SCK

Kamool: Lets forget about my project... Just help me with making such circuit that will cut communication on ICSP lines, maybe for future projects.

Really? :roll_eyes:

Make a connector? Or a relay with many contacts?

DrDiettrich: Make a connector? Or a relay with many contacts?

Relay is too big

I think you ought to look at the waterproof , ip65 type box, as advised earlier, as a simple , more reliable setup . It would also tidy up your installation as you still need to do something with the sticking out wires to stop them corroding etc . Very few follow your route for good reason .