This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Interfacing PushButton

I want to sense when a port pin goes high.
I have connected it to Vcc through a resitor
and pushbutton , so when pushbutton is pressed
the port pin goes high .But to configure port
for input I must first write 0xFF to Port .

     V
     |       R1       PB     |
     |_____/\/\/\____.--.____|Port Pin
                             |

Parents
  • No, you can sense hi or low. But the 8051 has built in pull-ups on ports 1, 2 and 3, so they will not be read as low when nothing is connected. Port 0 has no pull-ups, so you must supply them when using this port for I/O or as the mulitplexed data and address bus.

    The 8051 has many details like this. You should get a data book for the particular chip you are using and read it through. Several chips have different internal ram, cpu timing, external timing for peripherals, etc. It really pays to get in-depth knowledge of the particular part you're using or investigating.

Reply
  • No, you can sense hi or low. But the 8051 has built in pull-ups on ports 1, 2 and 3, so they will not be read as low when nothing is connected. Port 0 has no pull-ups, so you must supply them when using this port for I/O or as the mulitplexed data and address bus.

    The 8051 has many details like this. You should get a data book for the particular chip you are using and read it through. Several chips have different internal ram, cpu timing, external timing for peripherals, etc. It really pays to get in-depth knowledge of the particular part you're using or investigating.

Children