-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibiliy with AtMega4808 under MegaCoreX /w SoftwareSerial #98
Comments
Looks like an "endian" difference between the two MCUs. Try swapping the byte order on the ints on the receiver and see if it helps. Might also be useful to set the int size manually. |
Both MCUs report being "Little Endian".
So that might not be it. |
Hello !
So, I know that support for
SoftwareSerial
is limited, however I'm having an issue that I think it might be not related to it.I was wondering if the library is compatible with
Arduino Nano Every
(AtMega4809
orAtMega4808
) family, which is ran under MegaCoreX board framework. It's still8-bit AVR
, all my other libraries work, just this one does not.I replaced
Nano @ AtMega328p
in a project with aNano Every (clone) @ AtMega 4808
as I needed more memory, and ran the same code.My surprise was to see that though I had stable serial communication between two MCUs (
AtMega4808
andESP8266
, tested without the library), with this library, the received data between the MCUs was totally different.For example, I used the SendDatum over UART examples. Works totally fine with the little amount of data present in the examples.
But as soon as I added more data to it, I was receiving totally different numbers on the other side.
For example, on the
Nano Every (AtMega4808)
I sent the following struct:and the data:
And on the receiving end
(ESP8266)
I was receiving the following data:18:46:36.307 -> $ | 4.50 | 13238373 | 1701314964 | 7302252
Which looks to me more like a bit-conversion issue rather than something with
SoftwareSerial
.And it worked somewhat fine with the
Nano 328p
.(I say "somewhat", as with the
Nano 328p
I was receiving a lot ofCRC_ERROR
s due to low memory I guess -- I had only 91 bytes RAM left, however withNano Every 4808
there are no errors present whatsoever, just the data isn't the same).Same thing applies if I try to send it the other way (from
ESP8266
toNano Every 4808
). With little data is ok. As soon as I add more, I receive totally different numbers.Any lead to fix this would be very helpful.
Thank you.
The text was updated successfully, but these errors were encountered: