Discussion in "Project Help" started by    Deepakvaishu    Mar 20, 2017.
Mon Mar 20 2017, 08:24 AM
I am using a keypad to type the text message,I am using a 8051 microcontroller and a 4X4 matrix keypad . I tried too much,But not getting the exact logic to use a single key to type 3 different alphabets ,eg key 1 is used to type a, b, c depending upon the number of times the key is pressed.
I have used a variable 'count ' to check the number of times key pressed, again I have to display the letter on the lcd .....plz give me the idea how actually the multiple letters are identified depending upon the key pressed.
Since the Col are input(1) and Row are output(0).
Is the key released() before it is pressed second time to print the 'b' letter,
Plz help for the coding of this program.

Tue Mar 21 2017, 02:55 PM
There are two ways I'd tackle thiss.

Key down only - Use a timer and have 3 consecutive time slots - read 1=character, If read 2 = read 1 then use second character on the key, If read 3 also= reads 1 and 2 use third character associated with that key, read 4 resets read counter and goes back to character 1.

Key up then down - Read matrix, use character, start a timer on key up, if timer not run out and read 2=read 1 then use second character on that key. etc.

Hope that helps.

Thu Mar 23 2017, 05:34 AM
I can type the letters now when the particular key is pressed.But the problem now I am facing is that when the same key is pressed twice after a long delay I want the second letter to be printed to the adjacent position, How to recognise that the delay is more and the key should be printed at the next position on lcd.
How should recognise the delaybetween two keys pressed..If the delay is more than I want to increament the position on my lcd...
Plz help.

Thu Mar 23 2017, 09:14 PM
You have largely answered your own question.
Use one of the timers to track time, say in 10mS counts.
Note the count each time a key is pressed.
Calculate the interval.
A short interval is to select values for the same key.
A long interval is a new selection.

[ Edited Fri Mar 24 2017, 01:34 AM ]
 Deepakvaishu like this.
Fri Mar 24 2017, 05:22 AM
I got that we should use timer......But I am a little bit confused that we can use timer to create the delay of particular time interval....But I really dont know , how to track the time ?
I am new in this field...should I use a timer as a counter to count the delay?
plz help.
Fri Mar 24 2017, 06:05 PM
The best way is to use an interrupt to run the counter.
What software are you using ?
Sat Mar 25 2017, 07:59 AM
I am using Keil and 8051 microcontroller
Sat Mar 25 2017, 09:49 PM
I have attached code showing one method you could use.
It deals with timing, you will have to add the code to
scan a matrix to read a key.


[ Edited Sat Mar 25 2017, 09:53 PM ]
 Deepakvaishu like this.
Thu Apr 06 2017, 07:55 AM
Thanks for the attachment.
I have gone through your code . I did not got how the variable Keytime is updated.
Is it initially assigned as '0', and then when the timer interrupt occurs then it is incremented ??
plz help.

Thu Apr 06 2017, 05:38 PM

Is it initially assigned as '0', and then when the timer interrupt occurs then it is incremented ??


Yes, the timer interrupt is called about 50 times a second
and increments keyTime.
The main program continuously monitors and resets keyTime.

This bit of code starts Timer 0 and enables its Interrupt.

ET0 = 1;                      /* Enable Timer 0 Interrupts */
TR0 = 1;                      /* Start Timer 0 Running */
EA = 1;                       /* Global Interrupt Enable */

This is the Timer 0 Interrupt handler.
It reloads the timer counters then increments keyTime
up to KEY_REPEAT_TIME (200).
void timer0_ISR (void) interrupt 1
	 TL0=0;  //reload timer
	// TH0=0xdc;  //values give 10mS period
	 TH0=0xbc;  //longer time for Proteus simulation
	if (keyTime < KEY_REPEAT_TIME)   //hold at limit
 Deepakvaishu like this.

Get Social


Powered by e107 Forum System


Fri Sep 29 2017, 02:45 AM
i am doing the same project on verilog please contact me [email protected]
Wed Sep 20 2017, 12:36 AM
In a missing pulse detector using a 555 timer connected as a monostable vibrator with a PNP transistor,how does the positve input pulse turn on the PNP transistor?
Sun Sep 03 2017, 02:29 PM
How do I connect an <NOKIA 1100 LCD > to an atmega328P ?
Sun Aug 20 2017, 10:23 AM
i am intending to interface sd card with STM32F4 and want to write a file in sd card using SPI protocol but using HAL only. Can anyone help me PLEASE!!!!
Sun Aug 20 2017, 10:22 AM
Fri Aug 18 2017, 11:37 AM
hi @ angel patel i will attach a file i hope it will be helpfull for you
Mon Aug 14 2017, 09:57 PM
@ angel patel... just log in and post your problem
Mon Aug 14 2017, 01:45 PM
angel patel
hey any one help to make the led scrolling display
Sat Jul 29 2017, 07:09 AM
I see the code for step motor h l 298 to rotate 45 degree, but all delay time, if I want to input sensor to h the pulses to stepmotor
Thu Jul 27 2017, 12:05 PM
okay fine



Wed Oct 18 2017, 01:45 AM
Sun Oct 15 2017, 02:23 AM
Thu Oct 12 2017, 05:30 PM
Thu Oct 12 2017, 08:02 AM
Mon Oct 09 2017, 02:23 PM
Thu Oct 05 2017, 03:54 AM
Wed Oct 04 2017, 01:58 AM
Mon Oct 02 2017, 10:08 AM


Guests: 55, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 37902
Newest member: bvdb
Forum Activity
bvdb Avatar
Posted By bvdb
Wed Oct 18 2017, 01:50 AM
I purchased the RKitL51 8051 C compiler from Raiso...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Oct 16 2017, 11:44 PM
That looks complicated.Is 8051_BLK a standard 80...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Oct 15 2017, 07:29 PM
According to this, gmail should support POP3.https...
Help Avatar
Posted By Help
Sun Oct 15 2017, 03:21 AM
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Oct 14 2017, 08:06 PM
What happens if you ask for the full email ieAT+PO...
Help Avatar
Posted By Help
Sat Oct 14 2017, 02:28 AM
Dear all, AT // OK // 3.1 Bearer profile // Conf...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Oct 12 2017, 01:04 AM
I don't think the 0804 works as it should in Prote...
Bdavid.sam Avatar
Posted By Bdavid.sam
Wed Oct 11 2017, 01:54 AM
Are you simulating in Orcad ?Please post your cod...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Oct 10 2017, 09:43 PM
Are you simulating in Orcad ?Please post your cod...
Bdavid.sam Avatar
Posted By Bdavid.sam
Mon Oct 09 2017, 02:38 PM
Hello, This might be a beginner’s mistake but I a...