hi,
I have a problem in writing code for keypad scanning in C. My rows are connected to PORTB pin 0,1,2,3 and columns are connected to PORTC pin 0,1,2,3. Now for scanning purpose, how to concatenate each port 4 bits to form 8 bit and write in the form:
PINB.0 PINB.1 PINB.2 PINB.3 PINC.0 PINC.1 PINC.2 PINC.3
(written in this form to clarify)
so that i can perform comparison to some values like ==0x0F, 0x0D etc.
eg: if(PINB.0 PINB.1 PINB.2 PINB.3 PINC.0 PINC.1 PINC.2 PINC.3 == 0x0D ){}
Attached is interfacing picture.
thanks
I have a problem in writing code for keypad scanning in C. My rows are connected to PORTB pin 0,1,2,3 and columns are connected to PORTC pin 0,1,2,3. Now for scanning purpose, how to concatenate each port 4 bits to form 8 bit and write in the form:
PINB.0 PINB.1 PINB.2 PINB.3 PINC.0 PINC.1 PINC.2 PINC.3
(written in this form to clarify)
so that i can perform comparison to some values like ==0x0F, 0x0D etc.
eg: if(PINB.0 PINB.1 PINB.2 PINB.3 PINC.0 PINC.1 PINC.2 PINC.3 == 0x0D ){}
Attached is interfacing picture.
thanks