Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

4x4 keypad interfacing microcontroller PIC18F4520

Status
Not open for further replies.

zZzZ_zzZ

New Member
Hi! I am currently doing a security alarm project in school and I need help with the coding. I am using 74C922 and I have no idea how to code it. How do I scan the keypad when the output of 74C922 is A, B, C, D ? How do I indicate the 0000 = '1' , 0001 = '2' , 0010 = '3' , 0011 = 'F'........ ? Please help ;-;
 
If you want to use the 74C922, then consult it's datasheet - but don't you have enough spare pins on the PIC to do it directly?.

It is part of the assignment and all the components are soldered on the project board so I am not able to remove the 74C922. All I need to do is the coding part which I do not know how :(
 
Last edited:
Then consult the datasheet, getting people to do your work for you teaches you nothing.

I am not getting people to do my work tho, I just need some help like an explanation. I know the scanning of the keypad but not when the 74C922 is connected to the keypad. The data sheet did not mention anything about the outputs so it’s not helping me. Thanks for replying tho
 
Searching for 74C922 provides this image. The chip handles the dirty work of scanning the keypad, and provides 4 output bits A-D. The key pressed is presented as a 4-bit binary number.

The fifth pin to be aware of is the DATA AVAILABLE pin. When this pin is high(or maybe low? - check the data sheet), the state of A – D should indicate which button is pressed.

Read the data sheet to understand the exact sequence of events. This is a little help to get you started.
example-74c922-so.jpg
 
What a coincidence that wuchy143 liked this post yesterday. I'm working on a design for a macro keypad based around the Seeeduino Xiao. The Xiao has a full USB interface, so it can act as an HID keyboard. My initial thought was the keypad would be hard-coded for key functions I wanted. Using the Xiao's 11 I/O pins, my design had a 4 x 4 matrix keypad (8 port pins) and 3 LEDs for status indicators.

As I began working on the code, I realized the key functions could be set up from a PC, but this would require an I2C EEPROM. So Rev A added an EEPROM and a MCP23008 port expander to drive the LEDs, since I ran out of port pins. This did leave me with a spare port pin, which could be a DAC output, so I added a passive piezo beeper in case some audio feedback would be useful. A few more parts than my initial design, but there was still plenty of room on the board for the additional components.

Wuchy's like reminded me of this post and the 74C922. Hmmm. I wondered if this chip might have provided an easier way to free up my needed port pins. I searched the 74C922 on Octopart.com (very much recommended site for checking part availability!). The 74C922 is very much obsolete, so no Rev B need be considered.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top