thank you everybody for the valued replies ..
but i want to explain my initial thought just to put the ideas that came in my mind and to get feedback from you i would correct them and learn a lot ...
+ i really look into
1. why i put the diode in 5v rail:
i really didn't want to play with the 3v3 or introduce noise or increase its voltage for the microcontroller .. is that correct ?
+
i thought that its always better to have the clamping of surge voltages at beginning or as close as possible to the input of your circuit in the PCB layout ?
but now after your suggestion i can see that im actually clamping (5 + Vf) after the voltage drop on the 500ohm which means that the ADC of MCU will have more than 5v on its input.... really bad...
----------------------------------------------------------
A more convenient way is to use REFSEL = INTVCC1 (1/2 Vddana) and have your signal maximum to be 3.3 V. Then you set gain to 1/2. This way you don't need a separate reference ,just make sure your Vddana is a reasonably clean supply. And you can have full 0 - 3.3 V signal mapped into full ADC scale.l I personally prefer this variant.
to be honest i didnt go to that level in microcontroller, i played with arduino and mbed before which is really high level "you basicly dont know what is going on in the backscene" .. and now, im playing with 32-bit mcu ..
but i can see ASF framework have these options so it would be somthing like this:
right?
----------------------------------------------------------
Sorry to contradict you guys, you don't need the diodes to be connected to 3.3V but you do need a 3.3V zener (instead of the 5V connection). Even if you connect the diodes to the 3.3V rail the zener should be there to prevent excessing input current to elevate the rail voltage, or your µC would be feeding itself from the external source rather than the supplied current source, this could bring all sort of issues, like magic smoke escaping from the MCU or the PSU.
would it be better to have 5v zener on input without resistor and then the voltage divider ? or voltage divider then zener ? or it really doesn't matter (i guess it does because the voltage divider would protect the zener?)
but would that limit the design parameters because zener has dynamic internal resistance which has range that you have to be in ? so now the voltage divider selection is depending on:
- maximum input impedence of (adc)
- minimum output impedence of (sensor)
- zener dynamic internal resistor range? << if that even exist
is that correct? i really got all these questions in my mind and i think i would im learning a lot by knowing their answers
----------------------------------------------------------
yes, another option, a really good one when space is premium, is to use TVS ICs, a bit expensive for some applications but usually not a problem in industrial applications. (I do that for living)
thank you i will research about it..