Nano Every UART Buffer Size

I can't seem to find the UART buffer size in the Nano Every technical description nor in the chip data sheet. Please, what is the UART buffer size? What is it for a software serial UART?

Thanks,
John-

Take a look at the UART.h file in the core files for the NanoEvery.

Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino\UART.h

It looks to me like the Tx and Rx default buffer sizes are 64 but they be increased by powers of 2 up to 256.

What is it for a software serial UART?

For one additional than the USB serial certainly you should be using hardware Serial1 (Tx and Rx pins).

I believe that there are additional hardware serial ports (Serial2 Serial3) available with some modification to core files.

https://forum.arduino.cc/t/arduino-nano-every-access-to-4-serial/614358

Not sure of the actual hardware buffer size, from the data sheet it looks like only a single character buffer. The Arduino board package implements a 64-byte ring buffer for send and receive on the hardware serial, and software serial appears to also use 64 bytes, at least for receive, I don't see a specific definition for the transmit buffer, but it may use the same ring buffer code.

Why specifically do you need to know?

MCUdude's MegaCoreX implements all four serial ports, and allows for easily changing the clock frequency of the processor if you really want it to run at 20MHz.

Thanks for the responses. I'm using the Nano Every USB for programming and Serial1 for communicating with a motor driver. The software serial is used to write to a data logger. I'm not having a problem sending bytes to the motor driver, that works and it responds fine, but I am having trouble getting bytes back from the motor driver, so I was just wondering what the buffer size was as I explore different options for capturing the driver return bytes. The same procedure works fine on the Mega, but there I use Serial.event, which I'm told doesn't work on the Nano Every. Changing the core, or whatever, is far beyond by understanding or ability. So, at this point, I'm just curious as to what the Serial1, and software serial buffer sizes are.

Thanks,
John-

Please post your code and a link to the motor driver/data sheet.

There should be no difference between using Serial.event and if(Serial.available()).

If you can capture the driver return events with a second hardware serial port on a Mega, you should be able to do so on a Nano Every with Serial1. The default Rx buffer is the same 64 bytes on both.

It would be unusual to overflow a 64 byte buffer before you can read it, but if indeed that is happening, you can increase to 128 or 256.

Why do you think your communication issues are caused by buffer size and possible overflow?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.