ATtiny measuring voltage for battery charger
Use the ATTINY A/D converter. But you do not want the reference voltage near GND. The reference voltage determines the full scale voltage to which the A/D converter will convert. So you will want to have the VREF set to a voltage that is at or above the maximum battery voltage you will be wanting to read.