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

Back to Subject List

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


 
#77799 - RE: Replacing school hardware
Responding to: ???'s previous message
Hi Craig, I think the error you speak of is the missing debounce but the assignment had two parts, write one program with debounce and one without. Either way my code doesn't seem to work. Raghu has given me another idea which I will work on next. In the meantime here is my code with the debounce: To clear up some confusion the first three lines work together to set up port A as an input, similiarly the next three set up port E as an output. The professor recommended a 250ms delay for debounce, perhaps this is overkill but can it hurt?

.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 OR OFF
MOV A,#0FFH
MOV DPTR,#0F901H ;POINT TO PORT E
MOVX @DPTR,A ;TURN OFF ALL LED ATTACHED TO PORT E
DELAY:ACALL DLY250 ;CALL DELAY (SWITCH BOUNCE)
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 DELAY
CLEAR:DEC 40H ;CLEAR FLAG
MOV DPTR,#0F901H ;POINT TO PORT E
MOV A,#0FFH ;
MOVX @DPTR,A ;TURN OFF LED
SJMP DELAY

DLY250:MOV R3,#3
LOOP:MOV R4,#150
LOOP1:MOV R5,#255
LOOP2:NOP
DJNZ R5,LOOP2
DJNZ R4,LOOP1
DJNZ R3,LOOP
RET


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