Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I ran into some problems using the SoftwareSerial-Library of my Arduino Uno R3:

Sending and receiving signals (ASCII) works but depending on the length of the serial "response" some characters are missing.

So I think the topic should be the serial buffer of the Arduino.

Deep inside the code I found a line which sets the buffer on 16 (if RAM < 1000) and on 64 ( else).

I tried to change these values step by step on a maximum of 256 but the characters are still missing.

So:

1) Am I doing something wrong by just changing these values?

1b) Does the Arduino even have enough memory to buffer more than 64 bytes?

2) Is there a programmatic way to solve this buffer overflow problem (seems common)?

2b) Is it Arduino's clock rate, which is simple not high enough to empty the buffer in time?

Really appreciate your help, Thank you!

share|improve this question
By changing the allocated buffer size, are you also changing the buffer access code to utilize the increased buffer size? If not, the ring buffer code might be simply using the original buffer size. – Anindo Ghosh Jan 26 at 10:17
Apart from the above good point what's the baud rate you're trying and do you have anything else that may block interrupts? – PeterJ Jan 26 at 10:33
@AnindoGhosh No, I do not. Could you point out how to achieve this? Sounds like the very right approach! – DAS Jan 26 at 10:58
@PeterJ 9600 8N1 - Nope, I don't think so. The device works well with a USB2Serial Interface so the device is definitely sending the information right. – DAS Jan 26 at 10:59
@Darwin I'd have to say the source code for (a) transmit to port, (b) retrieve from port, (c) Serial.read() (d) Serial.write(), and possibly print() and println() need to be examined for buffer pointer changes. – Anindo Ghosh Jan 26 at 11:49
show 2 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.