Yes you can, but first you have to lower the supply voltage for the picprocessor. This can be done by using a LM78L05 and some capacitors.
Then you have to build a voltage divider for the measuring of the 12 volts, because the adc in the picprocessor may not come above the supply voltage.
Say bluid a divider of 3 so that 4 volts measuring is 12 volts of the battery.
In the software you can multiply than by 3 again.