I'm trying to use the MC9S12NE64 to monitor some batteries' voltages. The thing is, the voltage that I need to measure are either 24 or 48 V. I will monitor the batteries and set some kind of alarm when they reach a determined low voltage. I know that the ATD input pins have a maximum voltage rating of 3.3 V on this microcontroller. So my problem is that I need to scale the batteries' voltage from the 0 - 24 V (or could also be a range from low voltage to 24V) range to the 0 to 3.3 V range, so I can use the on-board ATD to determine their voltages and don't overload the microcontroller. Can someone point me in the right direction as to what I will need to accomplish this? I'm kinda lost on this. Any help is really appreciated.
Just as Lundin said, 2 resistors should do. I'd say 10 K and 1K, with 10 K connected to battery and 1K to GND. This forms a 1/10 voltage divider and should get yous voltage down to 0-2.4V...
Also as Lundin sujested a 3.3 zener is good for protection of ATD input...I think could be replaced with a simple diode clump to VDD (+ power)
Zener should be connected between the Inputs ATD pin and GND in order to protect the input from voltage > 3.3 V, since you have batteries of 24 of 48 volts.......Normally the voltage to ATD input should be below < 3.3 V but in any malfunction you don;t want to burn the input............