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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/10/03 17:55
Read: times


 
#45187 - RE: My Approach
Responding to: ???'s previous message
I think what you mean to say is: if I write 0 to a port pin, it is probably dangerous to put a "hard" 1 on it from the outside. Exactly. Don't even try it, unless you like smoke. (someone once explained to me: everything actually works on smoke. When the smoke escapes, it doesn't work anymore.)

To use 8051 port pins as inputs, you must make sure that they are NOT 0. Write 0ffh to p1 once, and you're in business.

Aside: if you write 0 to a port pin, and then read it, you will always see 0, no matter what happens outside.

As for your approach: you will only test for 8 cases.

00000001
00000010
00000100
00001000
00010000
00100000
01000000
and
10000000

Any other combination will lead in none of the "work" getting done.
What you will probably want to do is:

bit0: jnb acc0,bit1
call work0
bit1: jnb acc1,bit2
call work1
...

and so on, and write the "work" bits as subroutines.


List of 33 messages in thread
TopicAuthorDate
Port status and bit status            01/01/70 00:00      
   RE: Port status and bit status            01/01/70 00:00      
      RE: Port status and bit status            01/01/70 00:00      
   RE: Port status and bit status            01/01/70 00:00      
      is it possible to write like this            01/01/70 00:00      
         RE: is it possible to write like this            01/01/70 00:00      
         RE: is it possible to write like this            01/01/70 00:00      
            RE: is it possible to write like this            01/01/70 00:00      
         RE: is it possible to write like this            01/01/70 00:00      
         RE: is it possible to write like this            01/01/70 00:00      
            My Approach            01/01/70 00:00      
               RE: My Approach            01/01/70 00:00      
               RE: My Approach            01/01/70 00:00      
               RE: My Approach            01/01/70 00:00      
                  use of interputs for polling            01/01/70 00:00      
                     RE: use of interputs for polling            01/01/70 00:00      
                        RE: use of interputs for polling            01/01/70 00:00      
                           RE: project            01/01/70 00:00      
                              RE: project            01/01/70 00:00      
                                 RE: project            01/01/70 00:00      
                           RE: project            01/01/70 00:00      
                              RE: project            01/01/70 00:00      
                                 how come this happens            01/01/70 00:00      
                                    RE: how come this happens            01/01/70 00:00      
                                       RE: how come this happens            01/01/70 00:00      
                                    RE: Its you Waqar as Lance Austin            01/01/70 00:00      
                                       RE: Its you Waqar as Lance Austin            01/01/70 00:00      
                                       RE: Its you Waqar as Lance Austin            01/01/70 00:00      
                                          RE: Its you Waqar as Lance Austin            01/01/70 00:00      
                                    RE: someone Help            01/01/70 00:00      
                                       RE: someone Help            01/01/70 00:00      
   Thankyou            01/01/70 00:00      
      RE: Thankyou            01/01/70 00:00      

Back to Subject List