Bit Masks

In computer science, a mask is data that is used for bitwise operations, particularly in a bit field.

Using a mask, multiple bits in a byte, nibble, word (etc.) can be set either on, off or inverted from on to off (or vice versa) in a single bitwise operation. [Read more…]

Wide box Tiny box List
Ascent Descent

Registers and bit masks

Registers and bit masks

When I started with embedded my knowledge about programming was (and probably still is) very elementary. I often used logical operator like logical NOT (!), logical OR (| |) and logical AND (&&) but was almost ignoring the bitwise operators.

Handling registers is actually so simple that at first approach I wasted a couple of days and this was because bitwise operators are required to. Talking with friends of mine coming from Arduino, this problem seems to be much diffused. The trap seems to be a lack of basic knowledge of informatics and electronics. So in this article we continue reading...