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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/22/02 07:52
Read: times


 
#24757 - RE: LED+Switch trouble
hi;

$mod51

org 00H
jmp start

org 40H
start:

CLR A
CLR P2.6

SETB P2.0











restart:

CPL P2.0

Loop:
;.you are writing into p2.should use mov a,p2
;better is use of bit instructions jb/jnb p2.x
mov P2, A
;20 h is uninitailized so can give you anything and branching is uncertain.
ORL A, 20h
JZ restart

jmp loop

end

also switch contact can give jitters.sample switch atleast twice before deciding its state.the delay between samples could be of
the order of 10-20 ms.otherwise led transitions will be fast and may not settle to correct value.
regards
pranav





List of 9 messages in thread
TopicAuthorDate
LED+Switch trouble            01/01/70 00:00      
RE: LED+Switch trouble            01/01/70 00:00      
RE: LED+Switch trouble            01/01/70 00:00      
RE: LED+Switch trouble            01/01/70 00:00      
RE: LED+Switch trouble            01/01/70 00:00      
RE: LED+Switch trouble            01/01/70 00:00      
RE: LED+Switch trouble            01/01/70 00:00      
RE: LED+Switch trouble - thanks rob!            01/01/70 00:00      
RE: LED+Switch trouble - thanks rob!            01/01/70 00:00      

Back to Subject List