user19328: Page 14 says that the method should return the value 'h17'
typedef struct  {
  uint8_t data;
  uint8_t timestamp;
  unsigned char crc;
} tData;


int main(void)
{
  unsigned char* tempData = "snap";

    for(;;)
    {
      tData payload;
      payload.crc = crc8(tempData,sizeof(tempData));
      UDR0 = payload.crc;
    }

    return 0;
}


user7508: Because “h17” is an unprintable character, namely ASCII ETB. The 'h' in “h17” stands for “hexadecimal”, like the 0x usually used in C.
You should convert the value to an ASCII number if you want to print it, using for example Serial.print(payload.crc, 16); or – if you are not using Arduino core – (s)printf().

Edit: here is an implementation of my comment “sprintf() into a
buffer and dump the buffer to UDR0 one byte at a time”:
#include <stdio.h>

void print_byte_in_hex(uint8_t byte)
{
    // Print the byte in ASCII into an internal buffer.
    char buffer[8];
    sprintf(buffer, "%02x\r\n", byte);

    // Send it one byte at a time through the USART.
    for (char * p = buffer; *p; p++) {
        loop_until_bit_is_set(UCSR0A, UDRE0);
        UDR0 = *p;
    }
}


19328: <p><a href="http://www.hth.com/filelibrary/pdffiles/snap.pdf" rel="nofollow">Page 14</a> says that the method should return the value 'h17'</p>

<pre><code>typedef struct  {
  uint8_t data;
  uint8_t timestamp;
  unsigned char crc;
} tData;


int main(void)
{
  unsigned char* tempData = "snap";

    for(;;)
    {
      tData payload;
      payload.crc = crc8(tempData,sizeof(tempData));
      UDR0 = payload.crc;
    }

    return 0;
}
</code></pre>
 7508: <p>Because “h17” is an unprintable character, namely ASCII ETB. The 'h' in “h17” stands for “hexadecimal”, like the <code>0x</code> usually used in C.</p>

<p>You should convert the value to an ASCII number if you want to print it, using for example <code>Serial.print(payload.crc, 16);</code> or – if you are not using Arduino core – <code>(s)printf()</code>.</p>

<hr>

<p><strong>Edit</strong>: here is an implementation of my comment “<em>sprintf() into a
buffer and dump the buffer to UDR0 one byte at a time</em>”:</p>

<pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;

void print_byte_in_hex(uint8_t byte)
{
    // Print the byte in ASCII into an internal buffer.
    char buffer[8];
    sprintf(buffer, "%02x\r\n", byte);

    // Send it one byte at a time through the USART.
    for (char * p = buffer; *p; p++) {
        loop_until_bit_is_set(UCSR0A, UDRE0);
        UDR0 = *p;
    }
}
</code></pre>
