user41798: How does the Serial.print() transmit the data? Can you please explain this with respect to TX buffers? 
Also, What would happen if i try to output the data that is greater than 64 bytes? How is this transmitted?
And please explain the difference with Serial.write()
Thanks!

user4143: Serial.print() feeds the data into the TX buffer one character at a time (through the Print class's inherited .write() function which HardwareSerial implements). If there isn't enough room in the TX buffer for the next character it waits for there to be room available.
Characters are removed one at a time from the TX buffer and sent through the physical UART by the UART's TX interrupt.
To put it in more detail:

When you call Serial.print() it's actually calling Print.print(), because Print is a parent class of the HardwareSerial class.
Print.print() repeatedly calls Print.write() for each character to print.
Print.write() is a pure virtual function (which means it's only got the definition in the Print class and child classes must implement it).
HardwareSerial.write() implements the Print.write() function which takes the character and (with possible blocking while waiting for space) adds it to the TX buffer.
Serial is an instance of the HardwareSerial class.


41798: <p>How does the Serial.print() transmit the data? Can you please explain this with respect to TX buffers? </p>

<p>Also, <strong>What would happen if i try to output the data that is greater than 64 bytes? How is this transmitted?</strong></p>

<p>And please explain the difference with Serial.write()</p>

<p>Thanks!</p>
 4143: <p><code>Serial.print()</code> feeds the data into the TX buffer one character at a time (through the <code>Print</code> class's inherited <code>.write()</code> function which <code>HardwareSerial</code> implements). If there isn't enough room in the TX buffer for the next character it waits for there to be room available.</p>

<p>Characters are removed one at a time from the TX buffer and sent through the physical UART by the UART's TX interrupt.</p>

<p>To put it in more detail:</p>

<ul>
<li>When you call <code>Serial.print()</code> it's actually calling <code>Print.print()</code>, because <code>Print</code> is a parent class of the <code>HardwareSerial</code> class.</li>
<li><code>Print.print()</code> repeatedly calls <code>Print.write()</code> for each character to print.</li>
<li><code>Print.write()</code> is a <em>pure virtual</em> function (which means it's only got the definition in the <code>Print</code> class and child classes must implement it).</li>
<li><code>HardwareSerial.write()</code> implements the <code>Print.write()</code> function which takes the character and (with possible blocking while waiting for space) adds it to the TX buffer.</li>
<li><code>Serial</code> is an instance of the <code>HardwareSerial</code> class.</li>
</ul>
