Pages: [1]   Go Down
Author Topic: Serial TX buffer/blocking  (Read 697 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do calls to Serial.print() and Serial.println() block? If not, is there a finite transmit buffer that can be corrupted if I transmit too much data too quickly?

I am assuming there must be some kind of TX buffer since there is an explicit Flush method: http://arduino.cc/en/Serial/Flush
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 614
Posts: 49343
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Do calls to Serial.print() and Serial.println() block?
Depends on the version of the IDE that you are using, and how much data you are sending. In 0023 and earlier, yes, they block. In 1.0 and later, they put data in a buffer, if there is room. Otherwise, they block until there is room for the data in the buffer. The buffer is 64 bytes.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using 1.0 so I guess my method calls will block if/when they need to.
Logged

Pages: [1]   Go Up
Jump to: