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
  • "the port latches are loaded with FFh hence there are configured as inputs or outputs."

    The correct term, as used in the so-called "bible" for the 8051, is "quasi-bidirectional"

    "MAZIDI ... mentions that they are configured as inputs ... websites mention that, at power on /reset the port are configured as outputs ."

    These are common and unhelpful statements!

    Again, there is nothing in a standard 8051 to configure the ports as either "inputs" or "outputs" - they are always quasi-bidirectional

    Never rely on anything you just happen to read on a website; always confirm it with a reliable source - in this case, the so-called "bible" for the 8051:

    Chapter 1 - 80C51 Family Architecture:
    www.nxp.com/.../80C51_FAM_ARCH_1.pdf

    Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set:
    www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf

    Chapter 3 - 80C51 Family Hardware Description:
    www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf

Reply
  • "the port latches are loaded with FFh hence there are configured as inputs or outputs."

    The correct term, as used in the so-called "bible" for the 8051, is "quasi-bidirectional"

    "MAZIDI ... mentions that they are configured as inputs ... websites mention that, at power on /reset the port are configured as outputs ."

    These are common and unhelpful statements!

    Again, there is nothing in a standard 8051 to configure the ports as either "inputs" or "outputs" - they are always quasi-bidirectional

    Never rely on anything you just happen to read on a website; always confirm it with a reliable source - in this case, the so-called "bible" for the 8051:

    Chapter 1 - 80C51 Family Architecture:
    www.nxp.com/.../80C51_FAM_ARCH_1.pdf

    Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set:
    www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf

    Chapter 3 - 80C51 Family Hardware Description:
    www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf

Children