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.

Help for encoder & sensor

Status
Not open for further replies.

xxxnonoxxx

New Member
Can anyone tell me the information for the following questions?

1.How many i/o interface pins between keypad (4x4) and PIC18f4520?
2.How to detect if a key is depressed?
3.How to identify which of the 16 keys was depressed (decode the key from the (4x4) matrix)?
4.What is the logic level sensed by PIC18f4520 when the touch sensor is pressed?

Thanks
 
Without more details I can only give provisional answers.
  1. It should require 8 pins to connect a 4x4 keyboard
  2. Detecting a key is normally done in the firmware by enabling one row at a time and checking for a key being depressed. It can be done in hardware but it requires several chips to do what the uC can do.
  3. Again this is a function of the firmware. If you know which row was enabled you can see which column in that row was depressed.
  4. This is a really hard one. It could be either a high or a low. If you check the datasheet it will tell you what the definitions for high and low are in terms of the voltage present on a given pin. Except in this case the tables and graphs are not available yet for this part. Check the datasheet for the 18F452 and notice that Vih and Vil are nearly linear functions of Vdd.
 
xxxnonoxxx said:
Thanks Papabravo

Hmm about question 3, do you know how do use a encoder to identify the 16 keys?

You might try reading the 'sticky' at the top of this forum?, and looking at my keypad tutorial - although it's not for the 18F series, the principle is exactly the same.
 
xxxnonoxxx said:
Thanks Papabravo

Hmm about question 3, do you know how do use a encoder to identify the 16 keys?
I'm not sure what you mean by encoder. There is an MSI chip called a priority encoder (74LS148) which has 8 inputs and a 3-bit output which identifies the highest priority input which is active. Is this what you have in mind because you do not envision a a microcontroller with firmware solution?
 
xxxnonoxxx said:
Can anyone tell me the information for the following questions?

1.How many i/o interface pins between keypad (4x4) and PIC18f4520?
2.How to detect if a key is depressed?
3.How to identify which of the 16 keys was depressed (decode the key from the (4x4) matrix)?
4.What is the logic level sensed by PIC18f4520 when the touch sensor is pressed?

Thanks
Just expanding;

2, Make all the rows outputs, and all the columns inputs, make one row high, and scan the 4 columns to see if any are high, if one is, then you have found a pressed key
3, Depending on what row is high, and column, your decoded output would be Row * Column = Key (depending on your program)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top