free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Go to page  1 2 3 ... 16 [17] 18 ... 26 27 28
Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
sks
Wed Nov 05 2008, 02:01AM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
Hi balu,
thanx fr ur valuable suggestion. i m reading AYALA. i m new learner and trying to write code fr 8051 getting a lot of helps from RW.
thanks again
sks



Back to top


sks
Fri Nov 07 2008, 08:46PM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
hello Mr Arun,
good morning. i am waiting fr ur guidance, pl reply.
thanks
sks

Back to top


sks
Fri Nov 07 2008, 08:54PM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
hi pdi,
good morning, hv i don some thing wrong?
plzzzzzzzz reply.
thanks all
sks

Back to top


Arun Kumar V
Sat Nov 08 2008, 03:35AM

 User Offline
Registered Member #426
Joined: Sun Jan 28 2007, 11:50PM

Posts: 522
Thanked 219 times in 186 posts

Hello sahuji,

i am waiting fr ur guidance, pl reply.


no you haven't done anything wrong, we thought you were out of station or been busy, your last post was on Nov 5th and today you came back.


AVR and 8051 are not the same ( for the time being keep the thought of AVR out of your mind).

So, you are ready for timers, study the basics of timers in your book and of course our tutorial section.
and write a small program using timer



Arun

by the way(BTW), you can check this link : http://www.8051projects.net/forum-t14321-last.html
Back to top



This post has been thanked 1 time
 sks 
sks
Sat Nov 08 2008, 09:33PM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
hello every body,
good morning all. this is a small code fr hex keypad matrix. this is not working properly
please help by finding errors in the code. this is most urgent.
thanks all
sks
CODE:
;4*4matrix keypad sub routine
        org     00h
stay:
        mov     p1,#0fh
        mov     a,p1
        anl     a,#0fh
        cjne    a,#0fh,stay
here:
        mov     a,p1
        anl     a,#0fh
        cjne    a,#0fh,loop1
        jmp     here
        acall   init

        mov     dptr,#val1
loop1:        
        acall   find
        djnz    r1,loop1
        acall   init

        mov     dptr,#val2
loop2:        
        acall   find
        djnz    r1,loop2
        acall   init
        mov     dptr,#val3
loop3:        
        acall   find
        djnz    r1,loop3
        acall   init
        mov     dptr,#val4
loop4:        
        acall   find
        djnz    r1,loop4
        acall   init
init:
        mov     r1,#04h
        ret
find:
        rrc     a
        jnc     match
        inc     dptr
        ret
match:
        clr     a
        movc    a,@a+dptr
        mov     p2,a
        jmp     stay
val1:
        db 1, 2, 3, 4,
val2:
        db 5, 6, 7, 8
val3:
        db 9, 'a', 'b', 'c'
val4:
        db 'd', 'e', 'f', 0
end    
 


[ Edited Mon Nov 10 2008, 10:22AM ]

Back to top


pdi33
Sun Nov 09 2008, 06:44AM

 User Offline
Registered Member #1329
Joined: Mon Jun 04 2007, 09:28AM

Posts: 770
Thanked 185 times in 180 posts
sks wrote ...

hi pdi,
good morning, hv i don some thing wrong?
plzzzzzzzz reply.
thanks all
sks

hi sks,
why on earth do u think u have done something wrong???
In fact , u have been very focused and determined in ur objective which is obvious from ur progress.
btw, u and ur nephew are really progressing looking at ur keypad routine. have u tested it yet? what is the problem u r facing?



* inspired to develop,developing to inspire *
Back to top



This post has been thanked 1 time
 sks 
sks
Sun Nov 09 2008, 08:29AM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
hi,pdi
thanks fr the reply. my nephew is taking a short term course in EMBEDDED SYSTEMS at ISM in BANGALORE. i hv come to meet him & my son. he asked me to help, but u know i hv not yet written keypad subroutine . so i posted the code. i hv tested the code, its showing erratic values, and showing different values by pressing a single switch in each press. i don't understand his logic. if u can help him by solving his problem, it will be a great help. thanks
sks

Back to top


pdi33
Mon Nov 10 2008, 08:28AM

 User Offline
Registered Member #1329
Joined: Mon Jun 04 2007, 09:28AM

Posts: 770
Thanked 185 times in 180 posts
hi sks,
i too m am not getting the logic for the posted code . can u give the connection of the keypad to the uC?do note that 'a' will return the ASCII code of 'a' back to the variable and not the hex value . For that u have to declare 0x0a in the table.

anyways , glad to see that the whole family is into embedded programming.I would like to give our best wishes to ur nephew and son.


* inspired to develop,developing to inspire *
Back to top



This post has been thanked 1 time
 sks 
Ajay
Mon Nov 10 2008, 10:24AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 4042
Thanked 753 times in 712 posts
sks never forget to mention the behavior of the program on hardware.. well from what you told..

sks wrote ...
its showing erratic values, and showing different values by pressing a single switch in each press


it seems that scanning of keypad is not proper. It may also because of hardware design. So its better if you can provide the circuit. Do label the rows and columns.


www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top



This post has been thanked 1 time
 sks 
sks
Mon Nov 10 2008, 07:48PM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
hi pdi,
good morning, i was busy fr the whole day, sorry i couldn't reply u. any way i could write the code fr him in assembly, he translated to C its working fine. here is the code fr ur comments. i hv also attached the schematic.
thanks
sks
;A subroutine that continuously scans the keypad and returns the hex key
;pressed in the Accumulator & displays the hex value in port2
;my keys are like row0--0--1--2--3
;row0--0--1--2--3
;row1--4--5--6--7
;row2--8--9--A--B
;row3--C--D--E--F
org 0000h
main:
call kscan
mov p2,a
sjmp main

kscan:
call rowrd
jc kscan
call colrd
call convert
ret
rowrd:
clr c
mov p1,#0fh
mov r0,#0
jnb p1.0,gobk1
mov r0,#1
jnb p1.1,gobk1
mov r0,#2
jnb p1.2,gobk1
mov r0,#3
jnb p1.3,gobk1
setb c
gobk1:
ret
colrd:
mov p1,#0f0h
mov r1,#0
jnb p1.4,gobk2
mov r1,#1
jnb p1.5,gobk2
mov r1,#2
jnb p1.6,gobk2
mov r1,#3
jnb p1.7,gobk2
jmp colrd
gobk2:
ret
;Here i hv multiply the row no by 4 and added the column no
convert:
mov b,#4
mov a,r0
mul ab
add a,r1
ret



Back to top


Go to page  1 2 3 ... 16 [17] 18 ... 26 27 28  

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems