James Child
Newbie level 3
- Joined
- Dec 10, 2014
- Messages
- 4
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 13
- Location
- Hatfield, Hertfordshire
- Activity points
- 56
I'm new to PIC Microcontrollers & C programming and I've been set the task of creating my own Keypad scanning method that works exclusively on Port C (16F877A Microcontroller). Specifically, the program that uses this method only uses digits 1, 2, 4 and 5- so to be efficient, the scanner method is to only use RC0, RC1, RC2 and RC3 as the designated input/ outputs (I'm not allowed to use RC4-RC7). This essentially turns the 4x4 keypad into a 2x2 keypad.
I understand that the concept on scanning has Port lines set to high on rows, and lines set as input columns- when a button is pressed, this reads the low nibble of the port to detect the button.
Unfortunately, I have no idea how to code this in C, especially using the Port lines specified above. Can anybody shed some light on the problem and point me in the right direction? Thanks!:shock:
I understand that the concept on scanning has Port lines set to high on rows, and lines set as input columns- when a button is pressed, this reads the low nibble of the port to detect the button.
Unfortunately, I have no idea how to code this in C, especially using the Port lines specified above. Can anybody shed some light on the problem and point me in the right direction? Thanks!:shock: