Is there a fast / cheap / small way to (opto) isolate JTAG/SWD pins on device? - Page 1
Forum section: electronics / general

author: jnz
author_rank: Frequent Contributor
timestamp: July 02, 2020, 08:48:13 pm
content: Have:- Device in sealed box- Connector and pins that all must be to 20V DC tolerantWant:- To get some of these pins purposed as SWD programming to the micro. So I can plug in low voltage programmer on this primary connector and get a new flash without opening the device up. (Consider if I need to replace/update the bootloader, imagine unprogrammed chips in a finished product)- Device to have only one connector.- To be able to pass in 3.3V and have it sail through to micro, but pass in 5.1V+ and protect micro.Require- Very small realestate, not more than 150mm sq. Cost and complexity also important- Pins for DO / DI programming pins will not be used for anything elseIdeas- To buffer the SWD pins DO/DI and deal with power separately.- Not sure about getting SWD speeds with something like a reverse zener and resistor. Same for propagation delays and capacitance.Is there a quick goto for buffering JTAG/SWD pins to allow programming of a micro but have 0V-20V tolerance?

author: thm_w
author_rank: Super Contributor
timestamp: July 02, 2020, 10:05:02 pm
content: Opto is going to be difficult to fit in a size that small, you could probably use a standard one and scale the speed way back. But that means longer programming times.Try scaling back your programming speed and see what an acceptable time is, then design around being able to handle that speed.If all you need to do is handle 20V transient, then it does not to be isolated. Simple series resistor and some TVS's might work for IO.Then a series diode and linear reg for the 3.3V rail (assuming device is not using much power at 3.3V). But, feeding in 3.3V might be too low, 5V would be fine. Many options.

author: jnz
author_rank: Frequent Contributor
timestamp: July 02, 2020, 10:28:11 pm
content: Not transients, needs to be 20V DC tolerant.It also doesn't need to be opto, just a thought that came to mind.I could slow the programming down, but not any slower than 1-2Mhz. It's only a 512MB flash, but I don't want to introduce assembly and programming issues for the life of the product because I didn't figure out a better solution at this point.I could get away with 5V programming on this chip, but I'd rather plan for 3.3V SWD if possible. I agree, it's probably on the line to have 3.3V system and get a 3.3V signal through 20V protections.

author: thm_w
author_rank: Super Contributor
timestamp: July 02, 2020, 11:08:18 pm
content: 3.3V SWD is fine, the supply is a bit harder due to regulator dropout (if that method is used), but still doable.Can use a SRF to go open circuit once 20V is applied for example. If the supply current is not very high, then this makes your life easier.You'll have to see what parts are able to run at 1MHz, if you can come up with a resistor and TVS/clamp combination suitable. Then consider power dissipation as well.I guess SRF would work on the data pins as well at a higher cost, but I'd consider some series resistance to limit peak current.The super cheap method would be to use the devices internal ESD diodes. But uni-TVS is not too expensive.https://www.digikey.ca/en/articles/protecting-inputs-in-digital-electronicshttps://electronics.stackexchange.com/questions/235796/gpio-esd-protectionhttps://forum.arduino.cc/index.php?topic=521372.0https://www.eevblog.com/forum/projects/inputoutput-protection-with-polyfuse-and-diode/

author: langwadt
author_rank: Super Contributor
timestamp: July 02, 2020, 11:52:28 pm
content: Quote from: thm_w on July 02, 2020, 11:08:18 pmTVSs usually have quite sloppy voltages, so something designed to work with 3.3V might not really clamp until 8-9Vdiodes to ground and a 3.3 clamp (zener + transistor?) could work. if SWD will work at reasonable speeds with ~1K series resistorsthe power dissipation at 20V is not too bad

author: thm_w
author_rank: Super Contributor
timestamp: July 03, 2020, 12:15:53 am
content: Quote from: langwadt on July 02, 2020, 11:52:28 pmAgree, there are other clamps. TVS tend to not put characteristic curves in the datasheet so you have to think if its suitable or not.When I say TVS you may include zener type clamps as well:https://www.digikey.ca/en/products/filter/tvs-diodes/144In less critical applications LEDs can work for clamping too.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 03, 2020, 01:49:28 am
content: Err, 150mm squared, the whole thing; or 150 mm^2, just the units?If ~12 x 12 mm, you'll have a hard time putting on more than one of any kind of isolator. If you can find a digital isolator with auto-detect bidirectional operation, that may be the ticket.Or, possibly a USB isolator then USB-JTAG interface. Or just an isolating USB cable, or laptop. Assuming the usual situation of course, and not an embedded self-programming situation.I'm a bit suspicious of the latter use case, because that's what [drum roll please] bootloaders are for. A simple two wire UART only needs a dual opto to do the job. A bit slow perhaps (>1Mbps can be hard to find support for) but keeps the interface as minimal as possible.If it's something like an MCU loading an FPGA, you may be able to partial-load the FPGA for bootloader hardware, then finish the job this way. Or just put the MCU on the high side, in the same area you have available for the isolator, and communicate with it somehow.The low isolation may also suggest just using diffamps to sense it. This has issues with CMRR at high frequencies, but amps and comparators fit for the task are readily available. You would probably use up all your space on resistors (even using 0402s and packs), unless you find an in-amp, say, that happens to do the job.And if it's not isolation at all that you need -- this serves as example for how different a problem it is, versus merely limiting or clamping inputs.For limiting, series resistors to limit current, and clamp diodes to limit voltage, are a fine solution. Or you can get somewhat higher bandwidth using pairs of depletion MOSFETs (which act like small resistors for low voltages, but constant current sources for high voltages). Indeed, the latter can be used to obtain full mains cross-wiring protection (>160Vpk), if you need it! But still all common ground -- no isolation or CMRR to speak of, very different problem.Tim

author: profdc9
author_rank: Frequent Contributor
timestamp: July 03, 2020, 02:52:14 pm
content: Could you use a 2N7000/2N7002 as a bidirectional level shifter with low pull up resistors such as 1k to get fast enough risetimes or 1k on the low side and 4k7 on the high side ? That way one side can be referenced to whatever voltage is actually is at, as long it exceeds 3.3 volts. Use zeners on the interface signals just as protection diodes. Of course your input would have to source enough current.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 04, 2020, 01:41:51 pm
content: Have a look at the "ADUM" line of voltage isolator chips.They are small, use internal capacitors as the isolation barrier and some of them are designed for bidirectional protocols such as USB.Some have built in isolated SMPS circuits.Other versions have multiple channels (upto 6?)They are small, but not really cheap. You can't have it all.https://www.analog.com/en/products/interface-isolation/isolation/standard-digital-isolators.html

author: jnz
author_rank: Frequent Contributor
timestamp: July 06, 2020, 11:57:05 pm
content: Quote from: Doctorandus_P on July 04, 2020, 01:41:51 pmThere are 36 pages of ADUM parts. Did you have an approximate part you think works?I also have other replies here to make.

author: Warhawk
author_rank: Frequent Contributor
timestamp: July 07, 2020, 07:22:47 am
content: Quote from: Doctorandus_P on July 04, 2020, 01:41:51 pmFYI ADUMparts from ADI use a transformer-based isolation. TI and Silabs use a capacitive isolation.TI's overview is here:www.ti.com/isolationTo the OP:Consider the SN6505 or SN6501 for generating isolated power. Transformers from Wurth and Coilcraft are available.Additionally, you can use a capacitively coupled charge pump using the TLV1805-Q1https://www.ti.com/tool/PMP21953(the bottom solution)

author: daqq
author_rank: Super Contributor
timestamp: July 07, 2020, 07:42:06 am
content: See:https://www.analog.com/media/en/technical-documentation/data-sheets/ADuM160N-161N-162N-163N.pdfThey aren't 20V tolerant, but that should be doable with a bit of protection.Or you could use isolated tools - there are isolated JTAG and SWD dongles.

author: Jeroen3
author_rank: Super Contributor
timestamp: July 07, 2020, 08:45:05 am
content: For SWD you can use a I2C isolator. Eg: Silicon Laboratories Si8602If you also need reset then maybe Si8605.

author: jnz
author_rank: Frequent Contributor
timestamp: July 07, 2020, 08:08:10 pm
content: QuoteI think I've not explained my issue well...I need the 3.3 / 5V signal from SWD programmer to get to my chip. When a programmer is plugged in.I need these exposed pins I'm using for SWD to be 20V tolerant when a programmer isn't hooked up.If a higher voltage signal is present, I don't really care if the chip sees that as a logic level 1 or 0, doesn't matter.I might not be following some of the examples suggested, but it seems some are straight level translators that can't handle the 20V at all even remotely, and others seem to be expecting a higher level voltage for the SWD but that isn't the case.I'm wondering if I didn't just make it way too complicated and I can just Zener at 5.1V and call it a day?

author: langwadt
author_rank: Super Contributor
timestamp: July 07, 2020, 08:19:50 pm
content: Quote from: jnz on July 07, 2020, 08:08:10 pmif SWD will run at reasonable speeds with say 500R-1K series resistors so the power dissipation doesn't get outof hand it should work, might want to add a series diode to the zener to keep capacitance down

author: thm_w
author_rank: Super Contributor
timestamp: July 07, 2020, 08:52:49 pm
content: Quote from: jnz on July 07, 2020, 08:08:10 pmYou explained it well enough, people just read the title of your thread and didn't read further.Breadboard or solder up some clipping circuits and try it out, to get an idea of what values would work.

author: jnz
author_rank: Frequent Contributor
timestamp: July 07, 2020, 08:58:29 pm
content: Quote from: langwadt on July 07, 2020, 08:19:50 pmBig IF on that. I have no idea but I doubt it. I was thinking something like a 200ohm would be a lot for a series resistor. I think comparing this to I2C like a user did above makes a lot of sense, similar make up to SWD.It's the same problem with schottky diodes that would dump the overvoltage into the main rail then use a zener to keep that where it should be. That it revolves around stronger series resistors.

author: jnz
author_rank: Frequent Contributor
timestamp: July 07, 2020, 09:00:23 pm
content: Quote from: thm_w on July 07, 2020, 08:52:49 pmDid I mention my time crunch?I might have to farm this out on upwork or something. Unless someone here wants first crack.

author: thm_w
author_rank: Super Contributor
timestamp: July 07, 2020, 09:12:17 pm
content: Its already been 5 days, the parts could come in one day from digikey. Through hole parts to make it easier to breadboard, maybe.edit: no country code though so no idea where you are.

author: jnz
author_rank: Frequent Contributor
timestamp: July 07, 2020, 09:22:03 pm
content: Quote from: thm_w on July 07, 2020, 09:12:17 pmUSA, but man, I'm already stretched super thin. I need to make a call on this so I can make a decision on the injection molding so that we'll know we can program these without a bootloader (initial programming, fast reprogramming before shipping, including bootloader updates) and where in the assembly process to program before sealing the unit up.This is in addition to all the C work I'm struggling to get done. Suuuupper duuper overworked.Oh, and legacy updates to existing products, forgot that has to get done this week.Want to make some money?

author: Jeroen3
author_rank: Super Contributor
timestamp: July 08, 2020, 05:42:41 am
content: Do you really have to present the SWD pins on the connector? Would say, UART work as well via the bootloader?The problem with SWD is that's its bi-directional and not fitted with big line drivers.