Skip to content
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

Software Serial TX and RX #1654

Closed
gfwilliams opened this issue Apr 24, 2019 · 2 comments
Closed

Software Serial TX and RX #1654

gfwilliams opened this issue Apr 24, 2019 · 2 comments

Comments

@gfwilliams
Copy link
Member

Started here: http://forum.espruino.com/conversations/333049

Software serial RX works alone, as does TX. However together there are issues:

var s = new Serial();
s.setup(600,{rx:B3, tx:B4});
s.on('data', function (data) { print("<SoftSerial>"+data); });
setTimeout(function() {
//  s.print("H"); // fine
//  s.print("Hello"); // garbage
}, 500);

Only the last character sent seems to be received correctly - at any baud rate.

@MaBecker
Copy link
Contributor

Hmm 7 byte very small, is it possible to increase the buffer?

char buf[7]; ///< received data

@gfwilliams
Copy link
Member Author

Just done, to 64 - it does come out of JsVars so it's not going to cause too many problems I guess.

Still 7 bytes @ 9600 baud means you have around 7ms of execution time to fill before you hit issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants