Rather than trying to figure out the hex for the bits, I use the IC binaray number format, "0b". I set the bits using a binary mask, for example, to set the MOSI pin high, I use: bit_set(0x1008, 0b00001000) then to set the MOSI pin low, I use: (...) (28 years ago, 20-Feb-97, to lugnet.robotics.handyboard)
|