Reducing the number of pins needed to read a 12-key keypad where the buttons are grounded?
If the common connection is floating, an approach using an output pin and an ADC would be to tie one switch input terminal the output pin and the common input to the ADC input.  Then connect another switch input to ground and connect all the other switches to points on a string of eleven 1K resistors.  If one needs low-power wakeup and the processor's ADC pin doesn't have weak pull-up that can be pulled low through about 3K of resistance, add a 100K pull-up to the ADC pin.

When idle, ground the isolated I/O pin and set the other for weak pull-up.  That pin will be pulled down if any button is pushed.

To find out which button is pushed, set the output to VDD and read the ADC (preferably with the pull-up disabled).  The voltage will then indicate which pin is pressed.  If the switch makes even halfway decent contact (e.g. 3K or less of resistance) the voltage should be largely independent of switch resistance.