Where is serial buffer?

Where is the serial buffer located in Ar MEga 2560? in data or program memory?

I know that the default size is 64B and that i can increase that value. So i need to know if it will shrink my data -memory or not.

Also, there're 4 serial ports on the MEGA. Do they share the 64B buffer or is it 64B x4 in total?

thanx

A test showed that the buffer is in the dynamic data memory.

The amount of Bytes used is more than 1:1, but i couldn't figure out how to calculate it.

It would have to be data memory as program memory is not writable RAM.
To see what is going on just go look at the source code.
It is in HardwareSerial.cpp down in the core directory with the rest of the core library files.

--- bill

It's just allocated RAM, can't be anywhere else.


Rob