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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/03/05 14:40
Read: times


 
#88984 - Picky, picky, but no such thing!
Responding to: ???'s previous message
Michal Hupka said:
As Andy and Neil said on "classic" 8051 (or 8052) if you write the 1 to bit in register that match pin on microcontroller, it is setted as an input pin.

That was Andy & Neil; now here's Andy Neil!

Actually, there is nothing to set a standard 8051 pin as an input; all pins are always bidirectional.
However, if you write a '0' to a pin, it turns the open-drain driver ON and there is no way that anything external can ever force it to anything other than '0'
Therefore the input will just read '0' - irrespective of the external signal you might wish to read.

But If you write a '1' to a pin, it turns the open-drain driver OFF and so an external signal can take the pin either high or low - and the input can read the state of the external signal.

The is all explained in Chapter 3 of the "bible" for the 8051:

Chapter 3 - 80C51 Family Hardware Description:
http://www.semiconductors.philips.com/acrobat/v...WARE_1.pdf

Start reading at p2, "Port Structure and Operation" and pay particular attention to Figures 4 & 5






List of 17 messages in thread
TopicAuthorDate
on 8051 settings pins as input or output            01/01/70 00:00      
   re: setting pins as input or output            01/01/70 00:00      
   thanks            01/01/70 00:00      
      Do you not            01/01/70 00:00      
   It's depending on chip            01/01/70 00:00      
      depending on chip            01/01/70 00:00      
         No reason for negative Karma point            01/01/70 00:00      
            fine            01/01/70 00:00      
            not first post, not first time asked            01/01/70 00:00      
      Picky, picky, but no such thing!            01/01/70 00:00      
         oh, I did just that            01/01/70 00:00      
            Don't try this at home...            01/01/70 00:00      
               Maybe it still works...            01/01/70 00:00      
                  Eh???            01/01/70 00:00      
                     It's a joke, don't take it too literaly            01/01/70 00:00      
                        Sorry            01/01/70 00:00      
                           My english is still so poor...            01/01/70 00:00      

Back to Subject List