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

Port configuration

my question is about the power on / reset values of the 8051 ports:
at power on /reset, the port latches are loaded with FFh hence there are configured as inputs or outputs.

The 8051 Microcontroller and Embedded System
Using assembly and c by MUHAMMAD ALI MAZIDI JANICE GILLISPIE MAZDI ROLIN D. McKINLAY second edition PEARSON EDUCATION mentions that they are configured as inputs.

But most websites mention that,at power on /reset the port are configured as outputs .
which is correct?

****************
also look at the following code that monitors a switch connected to P1.5 and sets P1.7 if P1.5 is high

SETB P1.5 ; set P1.5 as input L1:JNB P1.5 ,L1 ; continuously poll P1.5,exit the loop if P1.5 SETB P1.7 ; set P1.7
will not the first instruction, SETB P1.5 itself produce an erroneous output since the port 1.5 pin has already been set high by the instn. SETB P1.5.

Thank you

Parents
  • MAZIDI ... mentions that they are configured as inputs

    There is NO SUCH THING as configuring '51 ports, whatever you do they are quasi-bidirectional

    any author of a '51 book that mention "ports configured as as inputs" is in my opinion totally incompetent.

    When you write a '1' to a port it will output a '1' which makes it possible to input to that pin, but, how do you explain "output '1' to a port" when that configures the port as input.

    The links Andy gave above punch holes as large as a barndoor through that utterly stupid expression.

    the ports of a 'plain vanills' '51 are quasi-bidirectional NEVER 'configured' as either input or output.

    Erik

    PS some very modern derivatives have ports that may be configured as output (push-pull)(, but still the default is quasi-bidirectional

Reply
  • MAZIDI ... mentions that they are configured as inputs

    There is NO SUCH THING as configuring '51 ports, whatever you do they are quasi-bidirectional

    any author of a '51 book that mention "ports configured as as inputs" is in my opinion totally incompetent.

    When you write a '1' to a port it will output a '1' which makes it possible to input to that pin, but, how do you explain "output '1' to a port" when that configures the port as input.

    The links Andy gave above punch holes as large as a barndoor through that utterly stupid expression.

    the ports of a 'plain vanills' '51 are quasi-bidirectional NEVER 'configured' as either input or output.

    Erik

    PS some very modern derivatives have ports that may be configured as output (push-pull)(, but still the default is quasi-bidirectional

Children