We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I want to fix (in C langage if possible) in bdata memory a word (u16). At the same address I want to use 2 bytes (u08) and always in the same area (0x20 and 0x21 addresses for example) to declare bits with sbit structure. --------------------------------------- u16 bdata myByte; sbit myBit15 = myWord ^ 15; sbit myBit3 = myWord ^ 3; // it does affect the right bit. Why ? --------------------------------------- union u{ u08 bdata msb; u08 bdata lsb; } myWord; union { u16 bdata word _at_ 0x20; union u myWord; } MYword; sbit myBit15 = myWord.msb ^ 7; sbit myBit3 = myWord.lsb ^ 3; ... // use { MYword.word; myWord.msb; myWord.lsb; myBit15; // not known by compiler ? myBit3; // not known by compiler ? }