Analog input protection is unique for each part. Many newer microcontrollers don't always have input diodes. I was surprised for example:
One of the effects in putting protection resistors in front of a sampling ADC is that the error becomes proportional to the difference between the previously sampled channel and the latest selected channel.
One of the effects in putting protection resistors in front of a sampling ADC is that the error becomes proportional to the difference between the previously sampled channel and the latest selected channel.
A simple way to avert this type of behavior is to always sample zero first, then the actual intended sample. This effectively isolates the previous intended input sample from the next intended input sample. Of course this doubles the ADC sample rate.
Best,
Analog input protection is unique for each part. Many newer microcontrollers don't always have input diodes. I was surprised for example:All CMOS devices have these diodes and they should NEVER be used as protection UNLESS it is clearly stated you can. do not assume they are there for protection against external events. They are there for ESD events during manufacturing/handling. Not during runtime
This is a common misconception
In some weird corner cases you have to resort to such trickery; example being STM32 hardware designers being such degenerates that they forgot to add buffer (transistor cost: $0.00000000000001) or a capacitor (much more expensive, of course) on the internal temperature sensor, so there is no way to sample it in any application requiring continuous sampling of something else at any meaningful rate.
But usually, the right thing to do is to just satisfy the ADC input impedance requirement, either by:
1) opamp buffer for high BW, or,
2) for low BW such as temperature sensors or battery voltage sensing, capacitor significantly larger than Csample (typically 100nF BOM reuse, but for high-accuracy 16-bit ADC might even need up to 1uF. Do the math.)
2) always solves sampling time problem (allows using of shortest sampling time), but still imposes a (more relaxed, but not non-existent) impedance requirement for whatever is feeding the capacitor, as a function of sample rate of that particular input. If you sample too often, even that large capacitor starts drifting in voltage due to charge injection from/to sampling capacitor. But now it is enough that source impedance is low enough to supply Csampl equivalent charge during every sample period, which is much easier to satisfy than having to deliver the same charge in sampling time, a much much shorter time. For example, you only need to read battery voltage every second. So sample period for that channel is 1 second (and only this is significant; other channels can happily sample at 1 MSPS). But sampling time can be just tens of ns for a fast SAR ADC, and sometimes it is not configurable, or if it is, you can't waste time sampling a slow channel because you have other channels to serve. In such cases the $0.001 100nF capacitor does the trick fine.
In some weird corner cases you have to resort to such trickery; example being STM32 hardware designers being such degenerates that they forgot to add buffer (transistor cost: $0.00000000000001) or a capacitor (much more expensive, of course) on the internal temperature sensor, so there is no way to sample it in any application requiring continuous sampling of something else at any meaningful rate.
But usually, the right thing to do is to just satisfy the ADC input impedance requirement, either by:
1) opamp buffer for high BW, or,
2) for low BW such as temperature sensors or battery voltage sensing, capacitor significantly larger than Csample (typically 100nF BOM reuse, but for high-accuracy 16-bit ADC might even need up to 1uF. Do the math.)
2) always solves sampling time problem (allows using of shortest sampling time), but still imposes a (more relaxed, but not non-existent) impedance requirement for whatever is feeding the capacitor, as a function of sample rate of that particular input. If you sample too often, even that large capacitor starts drifting in voltage due to charge injection from/to sampling capacitor. But now it is enough that source impedance is low enough to supply Csampl equivalent charge during every sample period, which is much easier to satisfy than having to deliver the same charge in sampling time, a much much shorter time. For example, you only need to read battery voltage every second. So sample period for that channel is 1 second (and only this is significant; other channels can happily sample at 1 MSPS). But sampling time can be just tens of ns for a fast SAR ADC, and sometimes it is not configurable, or if it is, you can't waste time sampling a slow channel because you have other channels to serve. In such cases the $0.001 100nF capacitor does the trick fine.
One of the concerns with ADC or Sampler charge injection (either + or -) during sampling is the effect this has on the driving amplifier. This was discovered eons ago with the high speed ADCs wreaking havoc of the signal source amplifiers and inducing significant ringing in those amplifiers. These effects caused the development of special purpose high speed op-amps designed specifically to drive such ADCs and they had very low dynamic output impedances (either open or closed loop) under high speed transient conditions. These were not trivial designs and maybe why they were not incorporated into the front end of some integrated ADCs within a more complex chip.
Best
In any case, it's a wrong idea to think about adding Rs and Cs before ADCs as simple "RC filters". Sampling ADC is a bitch of a load. RC is not only used as simple 1st order analog filter, that is often just a side effect, but instead C is used to provide low impedance for the ADC, and R is used to protect, isolate, increase stability, etc.
