Skip to main content
aoleon
Associate II
April 13, 2010
Question

Packing bits with byte (difference between f103 and f105)

  • April 13, 2010
  • 2 replies
  • 567 views
Posted on April 13, 2010 at 17:27

Packing bits with byte (difference between f103 and f105)

    This topic has been closed for replies.

    2 replies

    aoleon
    aoleonAuthor
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:47

    Initializing the variable works!

    Thanks!

    Alex

    Tesla DeLorean
    Guru
    May 17, 2011
    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 VenmoUp vote any posts that you find helpful, it shows what's working..