cancel
Showing results for 
Search instead for 
Did you mean: 

Packing bits with byte (difference between f103 and f105)

aoleon
Associate II
Posted on April 13, 2010 at 17:27

Packing bits with byte (difference between f103 and f105)

2 REPLIES 2
Posted on May 17, 2011 at 13:47

Perhaps your problem is one of initialization. Unless you explicitly clear that data structure it will contain random data except for the bits you set.

setup_a_t setup_a;

setup_a.value = 0;

setup_a.bits.a = (uint8_t) 3;

SPI_write_reg (REG, setup_a.value);

-Clive

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
aoleon
Associate II
Posted on May 17, 2011 at 13:47

Initializing the variable works!

Thanks!

Alex