Binary Math Tricks: Shifting to Divide by Ten Ain’t Easy

On small CPUs, you often don’t have a multiply or divide instruction. Of course, good programmers know that shifting right and left will multiply or divide by a power of two. But there are always cases where you need to use something that isn’t a power of two. Sometimes you …read more

Continue reading Binary Math Tricks: Shifting to Divide by Ten Ain’t Easy

Little Hex Tricks Make Little Displays a Little Easier

Depending on the device in hand and one’s temperament, bringing up a new part can be a frolic through the verdant fields of discovery or an endless slog through the grey marshes of defeat. One of the reasons we find ourselves sticking with tried and true parts we know well …read more

Continue reading Little Hex Tricks Make Little Displays a Little Easier

These Bit Twiddling Tricks Will Make Your Coworkers Hate You

In the embedded world, twiddling a few bits is expected behavior. Firmware is far enough down the stack that the author may care about the number of bits and bytes used, or needs to work with registers directly to make the machine dance. Usually these operations are confined to the …read more

Continue reading These Bit Twiddling Tricks Will Make Your Coworkers Hate You