NeoSWSerial icon indicating copy to clipboard operation
NeoSWSerial copied to clipboard

Add inverse_logic capability as per SoftwareSerial.

Open Matthew-Marks opened this issue 9 years ago • 4 comments

I had to add this functionality for the hardware I have, and it seems to work on that. I have not tested it in non-inverse mode!

Matthew-Marks avatar Jan 09 '17 17:01 Matthew-Marks

Thanks for adding a feature!

Have you tried all three baud rates? The changes should have minimal impact on the timing, but you should probably use a second Arduino to try both inverse & normal modes and all 3 baud rates.

If you don't have one, there's a test program (for a Mega) in the test subdirectory. It tries a few different things (all character values, RX only, TX only, TX then RX, RX then TX), with Serial3 connected to the NeoSWSerial port. There is a certain amount of synchronization with this kind of test, so it's not the best. A second Arduino (fully asynchronous) is the only way to catch some timing issues.

Thanks again.

SlashDevin avatar Jan 10 '17 16:01 SlashDevin

You're welcome. I tested on a 328 with 19200. No spare serial ports, but I also have a 168 board (should be compatible with the 328) so I'll add that to the same #define and connect them together.

Matthew-Marks avatar Jan 10 '17 18:01 Matthew-Marks

Would like to have this feature as well.

sandervandegeijn avatar Mar 08 '17 21:03 sandervandegeijn

I'm concerned about the timing impact at 38400. If it adds too many cycles, the inverse option may have to be selected at compile-time, not passed in as a run-time argument. Sorry I don't have time to test it. @neographikal, is it something you could test?

SlashDevin avatar Mar 08 '17 23:03 SlashDevin