Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/13/01 18:02
Read: times


 
#16577 - Need Correction in my code
Dear Programmers

Can anyone please correct my codes for scanning a key-bd using I2C port expander PCF8574.
Upon interrupt ,the software driven by I2C will scan the key-bd 4*4
but my problem is once it reads any of the key the programme hangs and the interrupt pin(pin3.3 ) goes low and remains their.Every time I
have to reload the programme and run it but it will only read one more
key.I am using a development board using Dallas 80C320 running at
24Mhz.I used to load the programme into the Ram and run it.

My code is as follows.
Their lots of system calls here
org 8000h
Start: acall Init ; initilization routine to activate PCF8574
mov a, #2
mov dptr, #Int1Isr
lcall setintvec
setb IT1
setb EX1
setb EA
ajmp Start
Int1IsrL:
push psw
mov psw,0
push acc
push 0
push 2
push dpl
push dph
acall Scan ; I2C routine to scan the Key-bd(which is worlking fine)
mov a,r1 ; the return of the key in r1
acall Report; routine to display the Key pressed
aljmp IsrDone
IsrDone:
pop dph
pop dpl
pop 2
pop 0
pop acc
pop psw
clr IT1
clr EX1
clr EA
reti
The scan routine which is workingfine was developed from examples given in this forum by the Gurus PeterDannager and BenZijlstra.(thanking both of you and 8052.com- for the valualble contributions wlhich enalbles guys lilke me to learn 8051 and write codes by ourself.)



List of 6 messages in thread
TopicAuthorDate
Need Correction in my code            01/01/70 00:00      
RE: Need Correction in my code            01/01/70 00:00      
RE: Need Correction in my code            01/01/70 00:00      
RE: Need Correction in my code            01/01/70 00:00      
RE: Need Correction in my code            01/01/70 00:00      
RE: Need Correction in my code            01/01/70 00:00      

Back to Subject List