Hi All,
I have a small problem. I'm designing a Data Terminal that has 23 buttons that need to be decoded by my PIC MCU. The problem is that I can't use 10 I/O pins from the PIC to decode a 5x5 matrix.
I haven't nailed down what PIC I will be using, but I'd like to stick to the 28 pin variety because the cost and footprint is very important. (The smaller the better.) This size PIC will give me the USART that I need, plus 6 I/O for the LCD display, and some extra for buzzer and maybe something else.
I already know about encoders like the 74C922, but these are *way* over budget for my project. Most of these IC's are over the $10 each range. I've looked into Resistor Ladders (R2R), but with a 10-bit ADC on the PIC and 23 buttons, I don't think the resolution is enough to be 100% accurate all the time.
Someone also suggested that I use the CCP feature with a capacitor and the resistor ladder and use the PIC to time the charge on the capacitor. But I'm not sure how that would give me any more resolution than a resistor ladder in the first place.
So does anyone out there have any cool tricks that I can use to decode a 23 key keypad with less than one port of I/O pins? And keep the cost very cheap! If I have to spend more, I might as well use an 18F8xxx series PIC and just use the extra ports.
Thanks ahead of time for your help!
I have a small problem. I'm designing a Data Terminal that has 23 buttons that need to be decoded by my PIC MCU. The problem is that I can't use 10 I/O pins from the PIC to decode a 5x5 matrix.
I haven't nailed down what PIC I will be using, but I'd like to stick to the 28 pin variety because the cost and footprint is very important. (The smaller the better.) This size PIC will give me the USART that I need, plus 6 I/O for the LCD display, and some extra for buzzer and maybe something else.
I already know about encoders like the 74C922, but these are *way* over budget for my project. Most of these IC's are over the $10 each range. I've looked into Resistor Ladders (R2R), but with a 10-bit ADC on the PIC and 23 buttons, I don't think the resolution is enough to be 100% accurate all the time.
Someone also suggested that I use the CCP feature with a capacitor and the resistor ladder and use the PIC to time the charge on the capacitor. But I'm not sure how that would give me any more resolution than a resistor ladder in the first place.
So does anyone out there have any cool tricks that I can use to decode a 23 key keypad with less than one port of I/O pins? And keep the cost very cheap! If I have to spend more, I might as well use an 18F8xxx series PIC and just use the extra ports.
Thanks ahead of time for your help!