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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/03/03 07:59
Read: times


 
#42817 - RE: delay - Saji
Responding to: ???'s previous message

This will cause all the LEDs on Port 2 to toggle or flash. I thought what Alan wanted was a running light where P2.0 is on then after a delay P2.1 is on and so on..

RunLed : mov P2, #0ffh

NewLoop: mov A, #0FEh ; Bit 0 is zero
Loop2 : acall delay
rl A ; Make the next bit 0
mov P2, A ; Update LED
jnz Loop2
acall delay
jmp NewLoop ; one iteration of 8 bits over. start next

Delay : ( Use MJKaras / RRaghu / CBrooks codes )

Suggest try it out on a simulator and then use it . Just wrote it here...


Raghu

List of 13 messages in thread
TopicAuthorDate
delay            01/01/70 00:00      
   RE: delay            01/01/70 00:00      
      RE: delay            01/01/70 00:00      
         RE: delay - Saji            01/01/70 00:00      
            RE: delay - Raghu            01/01/70 00:00      
         RE: delay            01/01/70 00:00      
            RE: delay            01/01/70 00:00      
   RE: delay            01/01/70 00:00      
   RE: delay            01/01/70 00:00      
   RE: delay            01/01/70 00:00      
   RE: delay            01/01/70 00:00      
   RE: delay            01/01/70 00:00      
      RE: Running lights            01/01/70 00:00      

Back to Subject List