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.
Hello ALL I need to access some of the bit positions of the SFR. But each time i tried to declare a variable of the type sbit , i get error C141: syntax error near sbit. I have read the manual and i even tried the statement :
sbit EA = 0xAF
Only SFRs with addresses that end in 0 or 8 are bit-addressable. Note that there are eight bits in a byte, and the bit addresses for SFR X0 range from X + 0 to X + 7, whereupon you reach SFR X8 with bits X8 + 0 to X8 + 7. There's method in the madness. For registers that are not bit addressable, you can set bits the good old fashioned way, with AND and OR operations. AND / OR also works on the SFRs with addressable bits.