user10229: How can i send numbers like 300 or 1024 ?
I'm using the recommendation of the atmel's manual.
void SpiTransmitir(unsigned char data)
{
   SPDR = data;
   while(!(SPSR & (1<<SPIF)));//{Serial.println("While");}
}

I imagined that one bit shift could be the solution, but it still fails.

user4143: You need to send two bytes - a high byte and a low byte.
There are two things you need to know with SPI:

You must wait for one byte to finish transmitting before you send the next
The whole transaction needs to be wrapped with a digital chip select signal.

So you have:

Chip Select idles HIGH
You lower Chip Select
You send one byte
You send the other byte
You raise chip select

At the receiver you:

Wait for chip select to go low
Receive one byte
Receive a second byte
Chip Select rises
You combine the two bytes together into one integer.


10229: <p>How can i send numbers like 300 or 1024 ?</p>

<p>I'm using the recommendation of the atmel's manual.</p>

<pre><code>void SpiTransmitir(unsigned char data)
{
   SPDR = data;
   while(!(SPSR &amp; (1&lt;&lt;SPIF)));//{Serial.println("While");}
}
</code></pre>

<p>I imagined that one bit shift could be the solution, but it still fails.</p>
 4143: <p>You need to send two bytes - a high byte and a low byte.</p>

<p>There are two things you need to know with SPI:</p>

<ol>
<li>You must wait for one byte to finish transmitting before you send the next</li>
<li>The whole transaction needs to be wrapped with a digital <em>chip select</em> signal.</li>
</ol>

<p>So you have:</p>

<ol>
<li>Chip Select idles HIGH</li>
<li>You lower Chip Select</li>
<li>You send one byte</li>
<li>You send the other byte</li>
<li>You raise chip select</li>
</ol>

<p>At the receiver you:</p>

<ol>
<li>Wait for chip select to go low</li>
<li>Receive one byte</li>
<li>Receive a second byte</li>
<li>Chip Select rises</li>
<li>You combine the two bytes together into one integer.</li>
</ol>
