jfenwick / analogswitchspdt

0 stars 0 forks source link

pitfalls to consider #1

Open un1tz3r0 opened 3 years ago

un1tz3r0 commented 3 years ago

if i follow correctly, the issue here is needing to plug and unplug to switch back and forth between your usb programmer cable and an external power source every time you need to reprogram the microcontroller as you debug your firmware, because you do not want the external power supply connected while you have the project hooked up to your computer... i have questions:

  1. why not? are you concerned that the external supply may backfeed the usb 5v supply from the computer and damage something? if this is the case, a simple diode in series with the usb's +5v wire would provide the same protection, unless...
  2. you are worried about ground loops; as in, the external supply's ground is not floating w.r.t. the computer's ground, so connecting them at the same time would cause a current to flow in the ground, messing up (amongst other things) the usb communication and potentially frying stuff... this is a legitimate concern, but could be easily mitigated by breaking the ground loop, either by using an external supply without a three prong mains plug, or by doing the same to power the computer, or if using a laptop, simply run off battery without the ac-adaptor plugged in.
  3. the issue with the analog switch here is that you still need to refer both sides of the switch at least to the same ground, so if the issue is grounding as stated above switching the data and power lines won't help at all, and switching the ground along with them may cause weird issues, although that might work.

if you do want to go the switch route here instead of a diode to protect your usb +5v line and taking care to eliminate multiple ground paths, you may want to use mechanical relays... there are some good inexpensive 4 or 8 relay boards and the nice thing about relays is they are almost all SPDT with common, normally-open and normally-closed connections.

hope this helps, miss you man and the good times we had at artisan's, you are in my thoughts often. hope you are well :)

jfenwick commented 3 years ago

I think I was just trying to learn kicad and learn some stuff about analog ICs. I battled it out for a while on electronics exchange lol https://electronics.stackexchange.com/questions/558234/analog-switches-able-to-send-bi-directional-digital-information

In the end I managed to get it kind of working. Then I realized I could just disconnect the 5V line from the programmer and none of it was actually necessary, but I kind of figured that was true from the very beginning.

I think about you too man. I miss those times. I hope you're doing well.