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

Back to Subject List

Thread Closed: Became flame-war

???
06/23/06 17:06
Read: times


 
#118955 - What about this?
Responding to: ???'s previous message
Arvind said:
The program written below should work as follows : ... switches

are connected to PORT 1 and LED;s are connected to PORT 2 ...

on hitting any switch the corresponding LED should bre ON

ie ... if we press switch 0 LED 0 should ON ... if agin we

press switch 0 then the LED 0 should become OFF ..


I would try it this way. The following code snippet must be executed every 10msec, invoked by a timer interrupt, for instance. The code uses one register set r0-7, so the original values from the main program must be saved and/or bank switching must be used:


mov r7,r6
mov r6,r5
mov r5,r4
mov r4,r3
mov r3,r2

mov a,p1
mov r2,a

cpl a
anl a,r7
anl a,r6
anl a,r5
anl a,r4
anl a,r3

mov r0,a
orl a,p2
mov r1,a
mov a,r0
anl a,p2
cpl a
anl a,r1

mov p2,a

I'm busy right now, will comment it later.

Kai

List of 32 messages in thread
TopicAuthorDate
switch and LED interface problem            01/01/70 00:00      
   Duplicate thread            01/01/70 00:00      
      DIFFERENT            01/01/70 00:00      
         Still unformatted and NO comments            01/01/70 00:00      
   Mr. Andy Neil            01/01/70 00:00      
      Help            01/01/70 00:00      
      Seniors, not baby sitters            01/01/70 00:00      
         Tell it to the Teddy Bear...            01/01/70 00:00      
         comments are added ... have a look again            01/01/70 00:00      
            Formatting!            01/01/70 00:00      
            LOOK AGAIN ... MODIFIED ...            01/01/70 00:00      
               This is hopeless!            01/01/70 00:00      
                  FINAL MODIFIES CODE ... have a look            01/01/70 00:00      
                     why do you check for keys a few microsec            01/01/70 00:00      
                     Debounce scheme cannot be identified            01/01/70 00:00      
                     I had 15 minutes waiting for someone and            01/01/70 00:00      
      no way            01/01/70 00:00      
         i dont know            01/01/70 00:00      
            He responded this morning            01/01/70 00:00      
               He wiil strike again on Monday            01/01/70 00:00      
   Spaghetti code            01/01/70 00:00      
      Before (re)writing            01/01/70 00:00      
      Again            01/01/70 00:00      
      and he comkplains about the tomato sauce            01/01/70 00:00      
   What about this?            01/01/70 00:00      
   HELOOOOOOOOOO !!!...            01/01/70 00:00      
      Why are you shouting??            01/01/70 00:00      
      Pot calling kettle - Come in Kettle!            01/01/70 00:00      
      TANSTAAFL            01/01/70 00:00      
      Consensus            01/01/70 00:00      
   ????????????????????            01/01/70 00:00      
   hitting in dark            01/01/70 00:00      

Back to Subject List