We are using Cypress Microcontroller with Keil uVision 2 platforms. One of Cypress register OEB (address = 0xB2) non-bit addressable SFR registry. In our application we are planning to use as a bit addressable configuration. Is there easy way to do by using keil macros?
Registers that aren't bit-addressable requires you to directly (or through macros) use | & ^ and ~.
You can of course create macros SET_BIT(addr,bit), CLR_BIT(addr,bit), TST_BIT(addr,bit) if you want to.
One of Cypress register OEB (address = 0xB2) non-bit addressable SFR registry. In our application we are planning to use as a bit addressable configuration.
'planning' to do something the hardware is incapable of?
Erik
PS in addition to the above there is the possibility of a shadow register
unsigned char bdata OEBshadow;
OEBshdow^x = TRUE/FALSE; OEB = OEBshdow;
Did tried to use | & ^ ~ operators, but code size is becoming big to access 10 of those kind of registries.
Is there any Keil defined (well tested) macros available?
Just found following text in keil help, trying to understand how adding works:
"Not all SFRs are bit-addressable. Only those SFRs whose address is evenly divisible by 8 are bit-addressable. The lower nibble of the SFR's address must be 0 or 8. For example, SFRs at 0xA8 and 0xD0 are bit-addressable, whereas SFRs at 0xC7 and 0xEB are not. To calculate an SFR bit address, add the bit position to the SFR byte address. So, to access bit 6 in the SFR at 0xC8, the SFR bit address would be 0xCE (0xC8 + 6). "
Why would they be specific to Keil?
The only thing here that's specific to Keil is their language extension to exploit the 8051's bit addressability.
Where the object is not bit-addressable, it's back to plain, vanilla, standard ANSI 'C'.
Have you investigated Erik's suggestion of using a "shadow" variable that is bit addressable? That's certainly where I'd be looking...
How are you sure that it's specifically the | & ^ ~ operators that are causing the "bloat"?