Hi,
I have arduino pro mini and I need to connect several serial modules to it. I know about arduino mega - the sizes just don't suit me.
So I have a questions about serial buffers in arduino. I know that on-board Serial has 64byte buffer. So if data comes and I haven't received it to ram, it's got stored in that buffer. If new data comes and it overflows - previous data get's dropped.
So here is my question list:
- But what happens with software serial? Where it's got stored? On the serial buffer of sender?
- What happens if there is no serial on the other side (device is powered off)? Does data drops, or it's waiting in some kind of buffer until receiver appears?
- Is it OK to use several software serials in my code? What problems can I get stuck into? (As I know there is a single buffer for all softwareserials, but again I can't imagine where does that buffer located)
- I have an ability to disable unneded serials, should I do the SoftwareSerial.end() and then again SoftwareSerial.start() when I need? (I know when I need and when I dont need serials working, according to design there can be just one serial and one software serial running active at a time, and I can enable/disable them on-demand).
- I will use interrupts and SLEEP_MODE_PWR_DOWN in my code. Is it ok to use SoftwareSerial with sleep function? (I heard there is some problems with timing on interrupts&softwareserial)
- I am going to make my arduino power on by Serial interrupt. I will connect the 220ohm resistor to 0(rx) pin of my arduino and 2nd pin, and attach an interrupt on 2nd pin. So when the data is being sent to my arduino by serial it get's powered on and does it's job. Can the Serial data be damaged because of that resistor? Should I put a diode?
- Also havent found: What power saving mode does not freeze millis()? I am thinking what will be more energy cheap: use power mode with millis or buy RTC.
I really appreciate your help,
Thanks