One more quick question. The maximum output current is 50 mA?
That's the from the "Absolute maximum" table - the level where you may expect failure, not what's allowed in normal operation.
See the output voltage vs current graphs on page 406; "sink" current is shown up to 25mA, with a loss of about 0.5V, but source current is only around 5 - 7mA to get a similar voltage drop.
Also note the absolute max current through VDD and VSS, and the total power dissipation. Keep everything reasonably well under those, of you want the device to last.
There was a long discussion on here a while back about preventing any current to pins in analog mode, as it can cause problems if not latch-up in the device.
One of the most basic things is that as the ADCs need a low impedance drive (unlike using eg. a 1M in series to a digital pin to limit current), an overvoltage from the ADC divider may provide enough current through the protection diode to VDD, if no outputs are sourcing current & loading the supply more, to increase the device supply voltage and overvoltage it.
That can also happen via external protection diodes if the voltage divider is not calculated correctly. The diodes are last-resort and power fail protection rather than a normal operating part of the device.
Good design means always keep voltages within the correct limits.
Each port pin already had protection diodes to Gnd and Vcc so only requirement is not to exceed their max current (20mA). So if reading a 9V signal then use a >200Ω resistor in series (assumed Vcc=5V). However, it's better to use a higher impedance resistive divider.
"Real Bad Idea" ™
The whole device may be taking 5mA or less when running on the internal oscillator.
That means your 9V via 200 Ohms, dropping 1V across the resistor at 5mA, could massively overvoltage the device.
That's an example of why you should
never rely on the input diodes as part of the overall circuit function.