Discussion in "Project Help" started by    Severus    Jun 5, 2007.
Thu Jun 07 2007, 09:36 pm
#11
just click on the thank button lol kidding.. its ok brother.. my site, i made it for this purpose only.. for everyone who want any kind of help i am happy that i am able to help you.

ok.. now regarding keypad.. you have to write a small program.. just to read and display the value from keypad. so is like this way...
we have 4 rows, and 3 columns. we will scan the rows one by one...
well i dont know the keypad is constructed, but i will just give you some idea... according to design there in my mind.
you make R0 = 1, by setting the pin connected to row 0 of keypad. then sense the columns connected to PortB for 0. if any of the column is zero then key is pressed.
e.g.
you have pressed number 2. so while sensing... you make R0 = 1 and you read from Port B. you get a value 0x05 it will be better if you AND the read value from Port B with 0x07 so you will just get the value of Pins connected to columns only, reduces the error.
so in binary we will get a value B'00000101' C0 = 1, C1 = 0 and C2 = 1
i.e. in row 1 key 2 is pressed. this way we will do the scan. so when reading from keypad, you make the rows One, one by one first R0 then read the column, then R1 and read the column, then R2, then R3...
i hope you understood the concept of scanning and reading the keypad.
try making a small program just to scan and display the value.. i hope you know how to decode the value for 7-segment. if not then tell me i will explain it here.. :-)
 Severus like this.
Thu Jun 07 2007, 09:56 pm
#12
Thank you , and u have a great site indeed, and i wrote a program that reads a number and display, my problem is to do the math work, how can i let it do the math work ???
Thu Jun 07 2007, 10:00 pm
#13
thank you brother, ur site is great indeed, and it helped me alot, i wrote a program to get a number , then display it , i wrote this, but the problem am now in is to write the assembly cde to do the math , thats the problem , can u help me ???
Fri Jun 08 2007, 12:06 am
#14
ok.. now its really simple.. get one number and store it in a register and then get second number.. put it in accumulator.. and simply apply maths.. i think we have instructions for that.. isn't it?
you can do one thing.. more.. like.. press a number and then to confirm the first number press #
and then second number and then # to save the second one..
now press * to select the math function, e.g. if pressed once +, pressed twice then -, thrice * and fourth time ÷
after selecting the function press # to get the result... i think its really simple..
try the simple + and - functions for now.. and tell me the results..
 Severus like this.
Fri Jun 08 2007, 12:33 am
#15
LOOOL , not easy at all, How do u do that the confirm after the number , and to recognize that it confirmed , and then take the operation and recognize it , am afraid am not that good with the 8086/8088 assembly , can u show me a sample , please

Regards
Fri Jun 08 2007, 01:15 am
#16
LOL you dont have to thank me eveytime...
bro, i don't remember 8086 programming anymore, really.. but as i know controllers so i am explaining you the concept or the basic behind it..
ok.. lets put it this way.. you said that you are able to get the i/p from keypad in your previous post right?
so.. you can also store the i/p received right?
and.. u can put this keypad routine in a subroutine so whenever you need to read from keypad you just call this routine, µP will work in µSecs so will be faster to process the routines..
what i want is this way.. (i give you the steps because i don't know assembly sorry for this )

clear the register on which number to be stored
get_num:
display number (will be zero in this case. coz starting)
call keypad_routine
store the received number
display it
check if pressed key is #
if yes save the number to some location and jump to second_num
if no then jump back to label get_num: and get the key and current pressed number will be there on the display as well as in the register where u want to store it.
second_num:
same as we did above,
but now we will wait for either #or * to be pressed..
make only + for now..
so if u press * + is selected and then press # to get result.

I am trying my best to explain.. but i really don't have any idea how to do this in microprocessors.. but i am sure you will do it..
please try writing something like what i explained above i am sure you will reach somewhere
 Severus like this.
Fri Jun 08 2007, 03:42 pm
#17
ex,we're talking about microprocessor or microcontroler.Microcontroler,i believe.there are some differences between them.but why do sevenus use 8086 assembly.i think we must use Read51
Fri Jun 08 2007, 03:53 pm
#18
it might be his assignment work... I am happy he is doing on his own.. i mean i am just guiding.. not giving the codes.
he has a course to do.. so it comes under it.. so is ok.. the way it is..
Fri Jun 08 2007, 04:13 pm
#19
Wind, its microprocessor , and yes its a project for the microprocessor , and i thank Rickey Deeply , cause without him i didnt know where to start , and what to do, he he did a great guidance for the thing, and i have him as a reference at the end of the project documentation
and i think its OK, asking some one, since he didnt give me any code , or hardware EWC
Fri Jun 08 2007, 04:23 pm
#20
yes u gave you just the guidance.. and u understood my point on the mail perfectly.. and i am very happy!!
that you doing everything on your own..

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am