Serial monitor with format other than SERIAL_8N1?

Pardon me if this is the wrong category but I'm using an alternative format in my Arduino Uno project as documented here: https://www.arduino.cc/reference/en/language/functions/communication/serial/begin/

I noticed that the serial monitor expects SERIAL_8N1 and displays gibberish because other formats can't be selected.

I will probably manage by using Software Serial as suggested in this thread or by 3rd party tools which support serial formats other than 8-N-1 e.g https://pyserial.readthedocs.io/en/latest/pyserial_api.html#serial.Serial but it would be nice if this was supported, or at least if a disclaimer was put explaining why it isn't

If you want to display data on the Serial monitor then why not simply use the default setting that it expects ?

Are you trying to send serial data to both the Serial monitor and another device using the same interface at the same time ?

Which Arduino board are you using ?
Consider using one with more that one hardware serial interface

I'm using two Arduino Uno boards and I'm limited to these because it's an university project for a course specifically for Arduino Uno

I'm actually trying to compare serial and parallel communication, to send some data over pins 8-13 (PORTB) from one device to the other and send the same data over serial and print/plot the amount of bits received in a time frame for each session.
I arrived at SERIAL_6N1 after thinking about what to do with the limited amount of pins and actually got into a problem just by trying out this code to see how it would run:

void setup() {
  Serial.begin(9600, SERIAL_6N1);
}

void loop() {
  for (int i=0; i < 64; i++) 
    Serial.println(i);

  delay(2000);
}

But I guess I could manage with SERIAL_8N1 for the hardware serial to use with the serial tools of the Arduino IDE and using software serial on some other pins to communicate between the devices, I don't need a high baud rate

I don't understand that statement.

What I meant was that it would be easiest for me if I could use a serial format of 8 data bits but I don't think it would be a fair comparison if I sent 8 data bits serially and less via a parallel transfer (I would modify the DDRB and PORTB registers directly)
I could however have all 8 pins of PORTB available with the hardware serial if I used a Atmega328p directly

It's not just your baud rate not matching up between Arduino and Serial Monitor? If you're looking for an alternative serial monitor though (because I have no idea why "SERIAL_6N1" is in your sketch, but that's just because I'm unfamiliar with doing that), CoolTerm has always been a good friend of mine. Maybe it has the options you're looking for?

Yeah, I was using 9600 in both the Arduinos and the Serial Monitor.
I've checked out CoolTerm and it supports what I need, I used pySerial before and it also supports what I need.
I'm thinking of a solution to work with the default Arduino tooling tho as I feel the project would go outside of the university course's scope if I included 3rd party tools.

I ordered a USB to TTL cable to do some tests with SoftwareSerial but I'll also try using 6 pins from one port and 2 from another to achieve 8 bit parallel transfer format

1 Like

One problem with 6n1 is that you cannot send 7-bit ASCII code using only 6 bits.

I think I understand why you want to use 6n1, you are trying to compare using Serial to transferring data on 6 pins in parallel. Because serial is on pins 0 & 1, you cannot use a single direct port write to transfer 8 bits at a time with an UNO, therefore you cannot do the comparison with 8 bits. Are you sure you don't already need a 9th pin for the parallel data, to clock the data into the destination device, or are you trying to implement some type of asynchronous protocol over a parallel port?

Adding extra settings and configuration to the Arduino IDE Serial Monitor would be a mistake in my view.

Its good that if you do a Serial.print() in a sketch the Serial monitor displays it. If there is gibberish then its likley that the baud rate is wrong.

Having to match databits, startbits, stopbits, parity and data polarity as well would be extremly confusing for a great many users.

One problem with 6n1 is that you cannot send 7-bit ASCII code using only 6 bits.

I didn't even realize the implications of the serial monitor being ascii based, in my example code I worked with values up to 63 which can be represented in 6 bits (and digits are all below 64 as well in the ascii table)... but seeing the raw numerical values instead of ascii would be a another feature request would be a dependency to this one :sweat_smile:

As for the data clocking and protocol, honestly this proved more of a challenge as I cannot find a single resource where parallel communication has been used in Arduino besides this answer on arduino exchange:

It seems to be interrupt based and using a separate pin to confirm data receipt then send the next set of data.. which is probably what I will do so I will need an extra pin for it, I would prefer it to trying to implement an asynchronous protocol with a buffer similar to how Serial is implemented in Arduino

Having to match databits, startbits, stopbits, parity and data polarity as well would be extremly confusing for a great many users.

I don't think it would be a mistake to include an advanced options page where everything is defaulted to the current values but I get that it would confuse a lot of people if the option was plainly visible

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.