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

pin writes optimized out

I am pretty new to this stuff, but I am usually able to work out problems on my own. I am trying to interface to some humidity sensor that uses it's own proprietary 2-wire serial interface (clock line and a data line). To make things easier, I declared sbits for each pin (SCK and DATA). When I try to compile and execute code like this:

.
.
DATA = 1;
SCK = 1;
error = DATA;
SCK = 0;
.
.

the compiler omits the line "SCK = 1". This is just an example, and it happens sporadically throughout the code. I read on some other posts that sbits are automatically volatile, and similar rumors, but the compiler is optimizing necessary lines out anyway. My compiler version is 6.20a. Thanks

Parents Reply Children
No data