title: ATTINY84: Weird problem with reversed byte order
body: <p>I am encoding 6 values (4x 3bit + 1bit) into a 16bit integer and transfer them via serial to an ATTINY84 splitting them into 2 bytes. That works all good until the point that I re-assemble the bytes into a 16bit int.</p>
  
  <p>Example: </p>
  
  <p>I am sending the following binary state <code>0001110000001100</code> which translates to <code>7180</code> and gets split into a byte array of <code>[18, 28]</code>.</p>
  
  <p>I am putting that byte array into the EEPROM and read it on the next power cycle.</p>
  
  <p>After power cycle my serial debug output looks like this:</p>
  
  <pre><code>18
  28
  7180
  </code></pre>
  
  <p>Awesome. Looks all good and my code for that part is:</p>
  
  <pre><code>byte d0 = EEPROM.read(0);
  byte d1 = EEPROM.read(1);
  unsigned int w = d0 + (256 * d1);
  </code></pre>
  
  <p>But now the weirdest thing happens. When I do a bit-by-bit read I am getting back:</p>
  
  <pre><code>0011000000111000
  
  should be:
  
  0001110000001100
  </code></pre>
  
  <p>via:</p>
  
  <pre><code> for(byte t = 0; t &lt; 16; t++) {
      serial.print(bitRead(w, t) ? "1" : "0");
    }
  </code></pre>
  
  <p>The bit representation is completely reversed. How is that possible? Or maybe I am missing something. </p>
  
  <p>Also I confirmed when I extract the actual 3 bit location to receive my original value <code>0..7</code> it's all off.</p>
  
  <p>Any help would be appreciated.</p>