Go Down

Topic: How fast ist client.wirte() on MEGA (Read 1 time) previous topic - next topic

PeterH


That's exactly what I'm asking for. What's the speed of client.write() in respect to serial3.read() setting up by 115200bps.


Forget client.write(). It is your serial output which is causing the problem.
I only provide help via the forum - please do not contact me for private consultancy.

markuszelg


Forget client.write(). It is your serial output which is causing the problem.

Are you saying the SPI is to slow? Is it not running a 4Mhz?

SurferTim

#17
Feb 11, 2013, 03:31 pm Last Edit: Feb 11, 2013, 03:41 pm by SurferTim Reason: 1
Quote
Forget client.write().

That is unwise. Both should be taken into account. The serial speed is the limiting factor here, but do not penalize yourself by not optimizing both interfaces.

edit: PeterH is correct about the speed limit. You can't send characters faster over the ethernet than you are receiving them on the serial port.

PeterH

#18
Feb 11, 2013, 03:51 pm Last Edit: Feb 11, 2013, 03:54 pm by PeterH Reason: 1

Are you saying the SPI is to slow? Is it not running a 4Mhz?


No, I'm saying that SPI is irrelevant to your problem.

Your problem is caused by the fact that the output serial stream is congested, which is preventing you from servicing the input serial stream. Both of these are massively slower than the SPI bus; the SPI bus is not the problem.
I only provide help via the forum - please do not contact me for private consultancy.

markuszelg

Okay, now we are deeply in the processors design.
I understood the protocol speed is not the limit in my use case (stream von NanoSerial->Serial3 on Mega->SPI MegaOut->Ethernet). Limiting is the processors handling of each buffer. And this is in same speed. With the fact of handling spi-transfer for each char, the code requests more processor time for serial out (over SPI) than the serial3.read on input site. Hence, the buffer goes full.

What options do i have? 1. speed up serial out handling in the processors register or 2. speed up serial spi sending with buffer as coded above?

Go Up