We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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 |
the port pin goes high .But to configure port for input I must first write 0xFF to Port .
V | R1 PB | |_____/\/\/\____________|Port Pin | | O | | 0 | | GND
Does that mean I cant sense a high pin with micon at all ???
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.
"You should get a data book for the particular chip you are using and read it through" Absolutely, however most newer datsheets omit the basic '51 info which can be found in the 3 80C51_Fam... documents found at: http://www.semiconductors.philips.com/products/all_other.html.
and the original Intel datasheet is on your Keil CD!