??? 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 |