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
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.
www.8052.com/.../120176 www.8052.com/.../121619
these resources are great for "traditional '51s", in this respect including the Rx2. Some modern derivatives (e.g. SILabs) have configurable ports.
Erik