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

Assigning name to a port

I am trying to write general procedure with the C51, who use name that I can easily assign to a port for a specific controler.

Ex: I want to replace port P4 in a procedure with a name like DATA

Parents
  • You can look up the SFR address for P4 in the processor-specific include file you are using and define another SFR name for that address. For example:

    sfr DATA = 0x90;    // Another name for P4

    0x90 in the example above is fictitious. You'll be using the address you found in the include file.

    --Dan Henry

Reply
  • You can look up the SFR address for P4 in the processor-specific include file you are using and define another SFR name for that address. For example:

    sfr DATA = 0x90;    // Another name for P4

    0x90 in the example above is fictitious. You'll be using the address you found in the include file.

    --Dan Henry

Children