If input pins and output pins of the processor and FPGA can not be exposed directly on a connector on the PCB board, what to do with SPI, I2C, JTAG, ISP, or in general a custom feature connector that makes unused processor pins available on a connector for future use?
There are good ideas and bad ideas.
Good idea: having foresight in the design process and accommodating possible expansion and stuff.
Bad idea: putting an edge connector near a whole in the enclosure and saying "fuck it, let the secondary market fix our problems".
Well, not in such condescending terms... but that's the sort of idea.
Compare early home PCs. Designs like the ZX Spectrum and C64 had a header or edge connector or whatever, that exposed the processor bus. ESD city right there! It should be no wonder that all those computers needed metal cages to keep all the awful logic switching noise inside; most of them had PCB designs without any ground pour, just logic routed over logic. Brutal, even at 3.58MHz!
And not that you can have perfect foresight, but you can at least think of a few possibilities and play with that. A purpose-made expansion slot, instead of an accident. Make it modular, add several (or an expandable option). The IBM PC originally had eight slots!
The most important thing, as far as the circuit's survival, is preventing huge transients from blowing out pins and chips. Just putting ESD diodes on a header, and leaving it exposed, is awfully minimal, but likely effective. Adding an RC or LC filter will increase survivability even further, and add EMI filtering.
This is not clear to me. Also to sense an analog signal you would expose an analog input pin on a connector.
At least an RC or LC filter, and diode clamp or zener. You don't want the signal being able to change any faster than you're sampling it at -- unless you're using that as a feature, not a bug.
Always filter your signals to the minimum bandwidth required for the application!
Or for an external interrupt you would expose a digital input pin on a connector.
A naked interrupt pin would be devastating to an edge triggered device! Apply RF of a few MHz and the poor thing just locks up!
Always sanitize your inputs!
Or to drive an external relais module you would expose a digital output pin on a connector.
That kind of load would most likely require a buffer anyway, even if it's just a BJT. A protected FET would be excellent, adding short circuit withstanding to the list of features.
What about common protection techniques for the below common I/O interfaces on a PCB board?
1. SPI connector for external SPI peripherals
1. Naked ~HC CMOS level logic: okay for short runs, especially with buffering.
2. Long runs require termination. Use source termination for point-to-point links, or a beefy driver with load termination (on the last load in a linear chain). Avoid star configurations. This is typical of modest lengths (low to fractional meters). Sort of related example: the old fashioned MFM/RLL hard drive interface used two ribbon cables, one carrying TTL level control signals, load terminated with a modest value resistor pack. The pack was socketed, so you could plug it into the last hard drive on the port.
3. Long runs are even more prone to noise pickup and radiation. Suggest RS-422/485. Signals are unidirectional, so they can be converted to differential and back without any problems. (The MFM drive interface also used RS-422, for the high speed data bits. That was transferred over a single cable per drive, so the controller card had two data ports, and one control port shared between max. two drives.)
4. For even greater distances, you can still use an RS-422/485 sort of scheme, but you may want galvanic isolation (to increase common mode range even further), and other features like line loss compensation. It may be more economical to go to an altogether more robust link method, like 10BASE-T, or a radio-over-copper method.
Always filter receiver inputs. You don't want RF racking up a dozen extra clock SCK edges between bits! This goes for differential as well as single ended!
2. I2C connector for external I2C peripherals
Recommend against it. I2C can be carried short distances, but even then, it should use shielded cables. It is difficult to buffer, because of the bidirectional (open collector) arbitration.
Even for modest distances, I'd recommend RS-422/485 or CAN instead.
3. JTAG connector for Programming and Debugging
N/A -- only ever used in a laboratory setting. If you've put yourself into a situation where you must use JTAG in the field, you've already lost.
I haven't seen a single JTAG header and programmer that will actually withstand any tiny amount of RF. The weak pull-ups are a worry; the lack of controlled signal quality is another (who's source-terminating what? Can it be chained, multi-dropped, or what?), and though most are provided with extra grounds (the 20-pin version is chock full of grounds: in fact, it's every other wire in the ribbon cable, precisely how you want it!), but they aren't usually well used (as soon as the ribbon cable enters the programmer, guess where the grounds go?..).
I've also seen a casual disregard for signal quality at the other end of most programmers and dongles: USB ports are so often connected utterly the wrong way, namely, with a ferrite bead from shield to ground. They're
intentionally bad.
Good "trap for young players", actually. If you can ever imagine a situation where not being able to use the programmer means certain death to your development or product... try to take as many precautions as possible to avoid that! For example, design a bootloader to work with one of those robust comm channels you'll have.
4. ISP connector for In-Serial-Programming
Similar, though potentially more troublesome because few-wire programmers may use open-collector arbitration. That is, I2C but with RST being one of the active pins, basically. Depends on the programmer. In any case, I still haven't seen one that's shielded, so you have the same vulnerability during use.
5. Feature connector to expose unused digital input pins, analog input pins, digital output pins, analog output pins and make these unused processor pins available for future use (e.g. extra PCB module)?
1. Don't (see above discussion!).
2. Use protection and filtering. Assume every pin is a potential hazard, and design accordingly.
3. Use covers and insulation to prevent damage to pins and ICs.
4. Use shielded covers and connectors to shunt ESD, short out EMI, and improve signal quality.
Good examples:
- Old timey game consoles. Bus is exposed, but under a cover, or at the end of a slot. The game cartridge itself may be vulnerable to ESD, but it's replaceable.
- PC expansion slots. The connectors cover the pins, so you can't touch them easily. (And if you're charged to the 10kV it takes to jump the remaining distance, frankly you're a retard and deserve the dead motherboard you'll get!) Furthermore, they are internal, and require tools to access (remove covers, mounting screws).
- USB, HDMI, basically any high speed data connection today. It's not possible to provide robust ESD protection, while keeping capacitance low enough to carry the data. So, the connector's metal shell protrudes, shunting ESD from outside sources, and being the first to mate with the plug. The sensitive data pins are tucked away inside. The male pins are on the peripheral, where again, they may be more vulnerable, but they're more replaceable too.
- Or Ethernet, which is transformer coupled, so can withstand quite a lot of craziness from the outside world.
6. USB port for data communication - Which chips provide good input protection?
Again, protection is somewhat unfeasible on High Speed links, but, if you know it will only be operated up to Full Speed, then the ESD protection and filtering can be quite robust.
These features are usually provided by outside parts; you'd have to look and see if any controllers offer ESD > 2kV HBM on the USB pins themselves.
Do all of them also provide charging functionality?
No, that's software.
USB host devices usually have a "protected switch" type device for the 5V output. Often.. they don't even have that, just a polyfuse or something. The peak surge currents through those can be devastating, even if the total energy is limited by the fuse.
Ideally, a multilevel "protected switch" is used, to provide a negotiated load current draw.
Such is the spec on USB3, which offers more voltage and current after negotiation.
Is Common Mode Choke always needed? FTDI recommends this in their guidelines, but they do not use it themselves in their evaluation boards. This is a bit confusing.
No, in fact it is almost always
worse.
USB is
not fully differential. The packet start and end symbols are unbalanced. For these to be communicated with fidelity, the entire connector-to-cable-shield-to-connector signal path must be maintained. A common mode choke of any useful value will deform these pulses, closing the eye and reducing the amount of interference that can be tolerated.
Furthermore, USB is source terminated only, so there is no load impedance for a CMC to work against, only the receiver input pin capacitance. You can add some RC damping to fake it, but this unavoidably attenuates the signal some, and still can't be very much (less than 100 ohms, say).
Absolutely solid shielding, from end to end, is the only good solution.
It should be no surprise that:
1. USB always uses shielded cables, even for very short links (except HMI devices usually, but those run at ~UART speeds),
2. Maximum link length is only a few meters.
7. Serial port for data communication - Does the MAX232 provide enough protection as such?
Yes-- those are usually on the order of 10kV HBM ESD rating, which is good enough not to need outside protection, even for reliable links.
The ISL3280 series (RS-422/485) are even rated for 16.5kV of ESD!
RS-232 is quite slow (the pin driver output current, and slew rate, are intentionally limited), but if this is tolerable, it's another physical-layer candidate for SPI. SPI is usually fast enough that you'll want 422 though.
8. Multiplexing I/O pins. What about the 1-to-16 and 16-to-1 multiplexer in the 74HC series?
Do these 74HC multiplexer chips specifically, and the 74HC chips in general, provide enough input/output protection? What about ESD, a short, driving output pin with +5V by mistake?
Not recommended, but probably tolerable in practice. CMOS output pins are more robust than input pins, though not by a huge margin. Not sure what the actual rating is (2kV? 4kV?).
Again, would recommend diodes and filtering.
Some other interfaces that come to my mind:
9. Telephone control application: What about an analog audio input interface on a PCB board, such as a DTMF decoder circuit connected to an input Coax connector to sense an audio signal? Is the DTMF chip as such tolerant to ESD and other issues?
Telephone has additional problems. Phone lines are long, and infrequently have been known to carry Zeus's ESD. Lines of this type must be isolated, as you would connect to mains lines: and for much the same reasons!
However you'd like to arrange communicating those signals over the isolation barrier... be my guest. (Transformers are common -- phone audio has limited and known bandwidth. The ring tone and DC bias stink, but can be dealt with. Otherwise, your basic DSP/DAQ signal chain, with digital isolators back to the processor, would be a fine way to go.)
10. Drone camera application: What about analog video input and output interfaces on a PCB board, such as a Video input Coax connector and a Video output Coax connector for OSD overlay on an analog CVBS video signal? Is the MAXIM chip for OSD overlay on a CVBS signal, tolerant to ESD and other issues?
Unfamiliar with that chip.
Video might be okay, but realize it's intended to be connected to shielded connectors again. They may make the assumption that it'll be okay...
Video, and RF in general, often has the bad habit of making things as small, and as vulnerable, as possible. That USB and digital logic pins are as robust as they are; that
they can be as robust as they are, is pretty remarkable. Not everyone makes the same efforts, though...
11. Remote control application: What about an Infrared output circuit with a small connector mounted on the PCB board to drive an external mounted IR LED via a cable connected to the connector?
Why not just put the IR LED on the board?
An LED drive would be much like a digital logic or RS-232 (single line, odd as that sounds..) application. Limited current, bandwidth.
Tim