According to the documentation I can use Serial.begin(9600, SERIAL_7E2); to initialize for 7e2 serial communication. This works fine for the AVR based Arduinos but fails for the Due. I am on 1.6.0. Is this a known issue that is going to be fixed or is there any specific reason why this is missing?
You mean you have looked at the variant code for the Due? I would not be surprised to hear that the Arduino code hasn't implemented that feature on the Due.
Are you asking for help fixing the code or you haven't looked at the code yet?
Colin (colin80 on GitHub) has done a lot of work on the Due serial implementation.
Thanks for pointing me to github. I looked up the current development branches --> even in the newest version this is missing. I created an issue sam: Missing support for HardwareSerial configuration · Issue #2966 · arduino/Arduino · GitHub
I did indeed work with the serial code on the Due. I've not had to use alternate serial modes but it seems like it should work. However, it probably wouldn't be
Serial.begin(9600, SERIAL_7E2);
But rather:
Serial.begin(9600, Mode_7E2);
But, Mode_7E2 seems to be undefined if you try to compile that. So, I'm not sure at the moment. It appears like it could work but no one has tried to really make it work yet. So, filing an issue on github is probably the way to go. It might even remind me to try to figure out how to make this actually work. ![]()
Actually SERIAL_7E2 is supported by Serial1, Serial2, Serial3 and SerialUSB but not by Serial. The point is that Serial is exposed through the 16U2 and this does not support it.
So far so good. Then I tried to substitute in SerialUSB but found that no matter what I try (even 8N1) I can not get any output through SerialUSB. I verified that my host does indeed detect the SerialUSB as a serial port. However I can not see any output there. Any hints why this might be the case?