Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Thread Tools Display Modes
Old 8th February 2008, 12:48 PM   (permalink)
Experienced Member
amenoera is on a distinguished road
Default 8-bit to 16-bit pic ? is that possible ?

hi all .

i have a pic microcontroller and i configured the port-d as input . port-d is 8-

bit, so in this case i have 8-inputs with values from 1 to 255 ,and if i connect

bit0 and bit1 to vcc i get this decimal value "3" and if i connect 4*4 keypad

so i have 16-inputs with corresponding value ,but in this case i cant press 2

buttons or 3 at the same time , now how can i get 16 inputs from 8-inputs

and can press or enter 2 inputs in the same time and get 2 values for it ?

is that possible ? am thinking for 2 days and i cant get it .

regards .
__________________
jax
amenoera is offline   Reply With Quote
Old 8th February 2008, 01:50 PM   (permalink)
Experienced Member
ronsimpson is just really niceronsimpson is just really niceronsimpson is just really nice
Default

If this link does not work search michrochip.com for application note 529.
http://ww1.microchip.com/downloads/e...tes/00529e.pdf

I do not understand what you are doing and it might take 2 days to understand it.
See application note. Normally a 4x4 keypad takes 8 pins from a micro. 4 pins as outputs and 4 pins as inputs. The keyboard is often thought as A,B,C,D and 1,2,3,4.

Output 1000,xxxx to test if column A. Input xxxx,???? To see if A1, A2, A3, A4.
Output 0100,xxxx to test if column B. Input xxxx,???? To see if B1, B2, B3, B4.
Output 0010,xxxx to test if column C. Input xxxx,???? To see if C1, C2, C3, C4.
Output 0001,xxxx to test if column D. Input xxxx,???? To see if D1, D2, D3, D4.
ronsimpson is offline   Reply With Quote
Old 8th February 2008, 09:26 PM   (permalink)
Experienced Member
amenoera is on a distinguished road
Default

first thanks for reply ,

but i think you miss understand somthing . to be come more understandable

and reliable . think about this 4*4 keypad as 16 "DIP SWITCH" and if you turn

on switch no.1 then you will recive "xx" value . but what if i turned on switch

no.1 , no.2 ,no.3,no.4?

in this case what will be the result ?

understand what i mean , thanks .

regards
__________________
jax
amenoera is offline   Reply With Quote
Old 8th February 2008, 11:10 PM   (permalink)
Experienced Member
 
Boncuk is just really niceBoncuk is just really niceBoncuk is just really nice
Send a message via MSN to Boncuk
Default

8 bits are enough for a keypad of 4X4.

Use a matrix of 4 lines and 4 colomns.
Boncuk is offline   Reply With Quote
Old 9th February 2008, 02:47 AM   (permalink)
Experienced Member
ronsimpson is just really niceronsimpson is just really niceronsimpson is just really nice
Default

A key matrix is not intended to work with more than one switch closed.
ronsimpson is offline   Reply With Quote
Old 9th February 2008, 01:54 PM   (permalink)
Experienced Member
amenoera is on a distinguished road
Default

in other words , i need to get 16 inputs from 8 input , and every bit in this input have a unique value , so i can enter 2 or 3 input at time . and get its values .


thanks , regards .
__________________
jax
amenoera is offline   Reply With Quote
Old 9th February 2008, 05:01 PM   (permalink)
Experienced Member
ronsimpson is just really niceronsimpson is just really niceronsimpson is just really nice
Default

Amenoera,

If I understand right you are not using a 4x4 keypad but dip switches. You need to add diodes on every switch then you can see multiple closed keys.
http://tomscarff.tripod.com/key2midi/key2midi.gif
Look at the link.
ronsimpson is offline   Reply With Quote
Old 9th February 2008, 05:29 PM   (permalink)
Experienced Member
amenoera is on a distinguished road
Default

look at this , page 3 .
Attached Files
File Type: pdf 21700di.pdf (175.0 KB, 8 views)
__________________
jax
amenoera is offline   Reply With Quote
Old 9th February 2008, 05:39 PM   (permalink)
Experienced Member
Mike, K8LH is a name known to allMike, K8LH is a name known to allMike, K8LH is a name known to allMike, K8LH is a name known to allMike, K8LH is a name known to allMike, K8LH is a name known to all
Default

Quote:
Originally Posted by ronsimpson
A key matrix is not intended to work with more than one switch closed.
Actually, you can decode multiple concurrent key presses on a multiplexed 4x4 keypad quite easily... Unfortunately it may not do what the OP would like because it's difficult to press more than one key at exactly the same time and if the keys are located in different scanned columns (or rows) they might be detected at different times (during a different scan period) unless the keypad code scans all four columns (or rows) sequentially before returning with key press bit results...

Last edited by Mike, K8LH; 9th February 2008 at 05:42 PM.
Mike, K8LH is offline   Reply With Quote
Old 9th February 2008, 08:46 PM   (permalink)
Experienced Member
amenoera is on a distinguished road
Default

i have an idea but i dont know if it can work ?

what i program the pic to that : "if bit0 & bit1 high then send value x - if bit3 & bit4 high then send value xx - if bit1 & bit6 high then send value xy" etc . . for only 16 input ?

or am wrong ?

thanks
__________________
jax
amenoera is offline   Reply With Quote
Old 10th February 2008, 02:39 AM   (permalink)
Experienced Member
ronsimpson is just really niceronsimpson is just really niceronsimpson is just really nice
Default

Amenoera,
I think your “page 3” example will not work.
The switches are “DIP Switches” so many may be closed. These are not key but switches.
Example:
Close switch A0 through 7 and switch B3 all other are open
RA3,2,1,0 = 1111b RB7,6,5,4,3,2,1,0, = 11111111
Scan switches
RA3,2,1,0 = 1110b RB7,6,5,4,3,2,1,0, = 00000000
RA3,2,1,0 = 1101b RB7,6,5,4,3,2,1,0, = 00000000
RA3,2,1,0 = 1011b RB7,6,5,4,3,2,1,0, = 11111111
RA3,2,1,0 = 0111b RB7,6,5,4,3,2,1,0, = 11111111
Problem: When switch A 0 through 7 are closed it shorts RB7,6,5,4,3,2,1,0 together.

This is why I suggested adding diodes. Diodes work, I have done this. See old message.
Attached Images
File Type: jpg Image1.jpg (90.4 KB, 10 views)
ronsimpson is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Problems switchin relay with PIC Andy1845c General Electronics Chat 5 17th November 2007 06:13 PM
HD44780 lcd help jay543_uk Micro Controllers 12 8th November 2007 03:26 PM
PIC ASM - Summation two 16 bit numbers (16f84) byrusber Micro Controllers 10 28th October 2007 08:40 PM
High ADC sampling rate PIC, 18F needed? bananasiong Micro Controllers 24 28th October 2007 12:13 PM
RS232 Converter e.chain Micro Controllers 0 6th October 2007 06:19 PM



All times are GMT. The time now is 10:46 PM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.