Even if you don't use Serial, 172 bytes of RAM will be allocated on a 328 and 676 bytes of RAM will be allocated on a Mega.
Here are some results for RAM use by Serial in Arduino 1.0 beta 3.First, output is now buffered but the buffer size has been reduced to 64 bytes. If you want the same size Serial receive buffer, 128 bytes, as in 0022, you will also get a 128 byte send buffer.Second, Serial is always loaded, even if it is not used by a sketch. This happens because of this line in main.cpp:Code: [Select] serialEventRun();
if (serialEventRun) serialEventRun();
There is no technical excuse for not having run-time buffer sizes for serial ports. Commercial embedded kernels have supported run-time serial buffer sizes for thirty years.
bool connectInterrupt(size_t rxSize, size_t txSize); // uses malloc bool connectInterrupt(uint8_t* rxBuf, size_t rxSize, uint8_t* txBuf, size_t txSize);
malloc is only about 500 bytes of code on AVR, so I guess it wouldn't be awful.
In 1.0 you lose more control.
It will be interesting to see how much larger it will be.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16