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 pin status

Hi using the nrf24e1, in the datasheet it says to set a pin on a particular port to an input or output for example port 0 pin 1 to output:

P0_DIR.1 = 0;

but this doesnt seem to be recognised in keil. what is the correct code for this?

cheers.

Parents
  • "in the datasheet it says..."

    Standard 'C' has no way of dealing with individual bits in a byte - so that has to be a compiler-specific extension.
    What compiler is the datasheet referring to?

    For Keil C51, you have to define "P0_DIR" as an sfr, and then define bit 1 within that SFR as an sbit.

    Or you can define the sbit directly.

    sfr and sbit are Keil-specific language extensions - look them up in the C51 Manual.

Reply
  • "in the datasheet it says..."

    Standard 'C' has no way of dealing with individual bits in a byte - so that has to be a compiler-specific extension.
    What compiler is the datasheet referring to?

    For Keil C51, you have to define "P0_DIR" as an sfr, and then define bit 1 within that SFR as an sbit.

    Or you can define the sbit directly.

    sfr and sbit are Keil-specific language extensions - look them up in the C51 Manual.

Children