Skip to content

Handling A LOT of data from serial #1193

Answered by phoddie
linfan68 asked this question in Q&A
Discussion options

You must be logged in to vote

You are correct that the serial implementation uses the hardware FIFO and that can overflow if not read often enough. Depending on the baud rate, your 300-500 ms processing has the potential for overflows.

One solution would be to add a software buffer to the serial implementation. That shouldn't be too difficult. Another approach would be to move the serial I/O to a worker. The worker runs in parallel, and can accumulate the data before passing it to the main task for processing. That has the advantage of keeping everything in JavaScript/TypeScript and being portable. I recall you mentioning that your hardware has lots of RAM, so a few KB for the worker won't be a concern.

FWIW – your on…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@linfan68
Comment options

@phoddie
Comment options

Answer selected by linfan68
Comment options

You must be logged in to vote
3 replies
@phoddie
Comment options

@linfan68
Comment options

@phoddie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants