Packing bits with byte (difference between f103 and f105)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2010-04-13 8:27 AM
Posted on April 13, 2010 at 17:27
Packing bits with byte (difference between f103 and f105)
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:47 AM
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..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:47 AM
Posted on May 17, 2011 at 13:47Initializing the variable works!Thanks!Alex
