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

Set port1 pins as 0 or 1

Dear all,
i am using P89V51RD2 (philips) 8051 micro-controller. i am doing some samples with NSK developemnt kit. In this i want to set the Port1 pint 0 to 7 as high/low continiously. I tried this by using the following lines,

P1 = 0x00 ;
delay(10000) ;
P1 = 0xFF ;

but still i am always getting around 5V on these pins. i searched lot of forums, but in that also they mentioned like this only. Kindly give your suggessions.......

Thanks and Regards
Radhakrishnan M

Parents
  • You don't configure, since the normal port don't have any configure register.

    If you set the pin as low, it will kept low by force - making it impossible for you to see a high input signal. This makes it incompatible for use as input. But can result in damages if processor pin is connected to external hardware that can draw pin high with strength.

    If you set the pin as high, it will be kept high by a weak internal pull-up. So external electronics can override and force the pin low. So you could have the processor read the pin state and see if it is still high or if it is externally drawn low. In shirt - it will behave like an input.

    This information is available in thousands of posts on hundreds of web sites. And google knows most of them.

Reply
  • You don't configure, since the normal port don't have any configure register.

    If you set the pin as low, it will kept low by force - making it impossible for you to see a high input signal. This makes it incompatible for use as input. But can result in damages if processor pin is connected to external hardware that can draw pin high with strength.

    If you set the pin as high, it will be kept high by a weak internal pull-up. So external electronics can override and force the pin low. So you could have the processor read the pin state and see if it is still high or if it is externally drawn low. In shirt - it will behave like an input.

    This information is available in thousands of posts on hundreds of web sites. And google knows most of them.

Children