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

How to set and retrieve Portbits in uVision C

How can I set and retrieve bitwise in uVision C? Similar to assembler P1.0 addresses Bit0 in Port P0.
I could not find any possiblility to do so unless I take the usual Bitaddressing techniques (masking and shifting)

Please answer to andreas.alef@web.de

Regards,

A. Alef

Parents
  • Thanks, but I didn't find it using the keyword sbit.
    "The sbit, sfr, and sfr16 data types allow you to access the special function
    registers that are available on the 8051. For example, the declaration:
    sfr P0 = 0x80; /* Define 8051 P0 SFR */"

    ok... but how do i address only one Bit like
    P0.0 = 1; or: P0_0 = 1;?

Reply
  • Thanks, but I didn't find it using the keyword sbit.
    "The sbit, sfr, and sfr16 data types allow you to access the special function
    registers that are available on the 8051. For example, the declaration:
    sfr P0 = 0x80; /* Define 8051 P0 SFR */"

    ok... but how do i address only one Bit like
    P0.0 = 1; or: P0_0 = 1;?

Children