parallaxinc / PropLoader

Parallax Propeller loader supporting both serial and wifi downloads
MIT License
27 stars 13 forks source link

Use two stop bits for packet driver / File-To-SD #51

Open Wuerfel21 opened 4 years ago

Wuerfel21 commented 4 years ago

There's a lot of stuff going on in the packet driver after a byte is received, causing it to miss the next start bit when using over ~200_000 baud When using two stop bits (tested by changing serial_mingw.c line 101 - this enables 2 stop bits for everything, which is less than ideal...), the maximum stable baudrate increases to about ~450_000. Empirically, this translates to ~70% faster loads (testing 200_000 baud 1 stop bit vs 450_000 baud 2 stop bits with a ~430K file)

Relatedly: Can the baud rate for File-To-SD become it's own config variable please?

dbetz commented 4 years ago

If you have a better packet driver I'd be happy to use it. The one in PropLoader is basically derived from FDS and is almost certainly not optimial.

Wuerfel21 commented 4 years ago

I don't think there's any major prop-side optimization that can be achieved without cutting functionality (for example, a less expensive packet checksum could be used at the expense of a higher likelyhood of errors - not sure how often the CRC errors out, anyways?) or spinning the packet handling off into a second cog.

As I said, setting 2 stop bits gets a good bit of extra performance out of the current driver.

dbetz commented 4 years ago

I'm afraid I don't have time to work on this right now. Sorry.