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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/20/04 14:35
Read: times


 
#77704 - Problem with my code
Hi, My assignment is to write a program which uses a momentary switch to latch an LED on/off. It seems to be intermittant as it's difficult to describe what it is doing...sometimes it works as expected and other times the led just blinks without latching. The switch is connected to pin0 of port A and the LED is connected to pin0 of port E.Any help would be appreciated.Thank you in advance.

.ORG 2000H
MOV A,#9FH ;SET UP
MOV DPTR,#0F803H ; PORT A
MOVX @DPTR,A ; AS AN INPUT
MOV A,#89H ;SET UP
MOV DPTR,#0F903H ; PORT E
MOVX @DPTR,A ; AS AN OUTPUT
MOV 40H,#00 ;CLEAR FLAG-IS LED ON/OFF
MOV A,#0FFH
MOV DPTR,#0F901H ;POINT TO PORT E
MOVX @DPTR,A ;TURN OFF LEDS TO PORT E
READ:MOV DPTR,#0F800H ;POINT TO PORT A
MOVX A,@DPTR
JNZ DELAY ;
MOV A,40H ;MONITOR FLAG
JNZ CLEAR ;
INC 40H ;SET FLAG
MOV DPTR,#0F901H ;POINT TO PORT E
MOV A,#0FEH ;
MOVX @DPTR,A ;TURN ON LED
SJMP READ
CLEAR:DEC 40H ;CLEAR FLAG
MOV DPTR,#0F901H ;POINT TO PORT E
MOV A,#0FFH ;
MOVX @DPTR,A ;TURN OFF LED
SJMP READ



List of 55 messages in thread
TopicAuthorDate
Problem with my code            01/01/70 00:00      
   RE: Problem with my code            01/01/70 00:00      
      RE: Problem with my code            01/01/70 00:00      
   RE: Problem with my code            01/01/70 00:00      
      RE: Problem with my code            01/01/70 00:00      
   RE: Problem with my code            01/01/70 00:00      
      RE: Problem with my code            01/01/70 00:00      
         RE: Problem with my code            01/01/70 00:00      
            RE: Problem with my code            01/01/70 00:00      
               RE: Problem with my code            01/01/70 00:00      
               RE: Problem with my code            01/01/70 00:00      
                  RE: Antiques            01/01/70 00:00      
                  RE: Problem with my code            01/01/70 00:00      
                     can't count            01/01/70 00:00      
                        RE: can't count            01/01/70 00:00      
                  RE: Problem with my code            01/01/70 00:00      
                     Validity of state            01/01/70 00:00      
                        RE: Validity of state            01/01/70 00:00      
                           RE: Validity of state            01/01/70 00:00      
                        RE: Validity of state            01/01/70 00:00      
            RE: Problem with my code            01/01/70 00:00      
               Another for the teacher            01/01/70 00:00      
               Fighting academia            01/01/70 00:00      
                  RE: Fighting academia            01/01/70 00:00      
                     RE: Fighting academia            01/01/70 00:00      
                  RE: Fighting academia more            01/01/70 00:00      
                  RE: Fighting academia            01/01/70 00:00      
               RE: Problem with my code            01/01/70 00:00      
                  RE: Problem with my code            01/01/70 00:00      
   RE: Problem with my code            01/01/70 00:00      
      RE: Problem with my code            01/01/70 00:00      
   RE: Replacing school hardware            01/01/70 00:00      
      RE: Replacing school hardware            01/01/70 00:00      
         RE: Replacing school hardware            01/01/70 00:00      
      RE: Replacing school hardware            01/01/70 00:00      
         RE: Replacing school hardware            01/01/70 00:00      
            RE: Replacing school hardware            01/01/70 00:00      
               RE: Replacing school hardware            01/01/70 00:00      
                  RE: Lisas problem            01/01/70 00:00      
                  Debounce, and define current problem            01/01/70 00:00      
                     RE: Debounce, and define current problem            01/01/70 00:00      
                        Defining debouncing            01/01/70 00:00      
                           RE: Defining debouncing            01/01/70 00:00      
                              You got it            01/01/70 00:00      
            RE: good old 6809            01/01/70 00:00      
      RE: Replacing school hardware            01/01/70 00:00      
         RE: Replacing school hardware            01/01/70 00:00      
            STUPID marketing policy            01/01/70 00:00      
               Possibly not entirely stupid...?            01/01/70 00:00      
                  RE: Possibly not entirely stupid...?            01/01/70 00:00      
            RE: Replacing school hardware            01/01/70 00:00      
               RE: Replacing school hardware            01/01/70 00:00      
   C.Steiner, Atari and dev. systems..            01/01/70 00:00      
   RE: Problem with my code            01/01/70 00:00      
      RE: Problem with my code            01/01/70 00:00      

Back to Subject List