Nano 33 IOT - use 9 bit on serial1

Hello there
I need to use 9 bits on the serial-port-1- will that be possible on the 33 IOT module ?

Thank you for your help

What do you mean? What device do you want the Nano to communicate with? Can you post a link to the device's specs?

I have some maritime instruments - using serial communication , but they are using 9 bits , not 8. Bit 9 is a command bit - so I have to read and write 9 bit word

I could do it by making me a bitbang module, but was looking for the possibility to use the internal serial port (1) for this. Speed is only 4800

The arduino core supports Serial with 5-8 data bits only. The common workaround is the use parity bit as 9th data bit. But you need to rewrite code youself. See this thread

and this
it is not related to arduino, but shows general principles very well

Yes , was thing about that , but how to read the parity bit - is there a possibility for that ?
Format is a follows::

  • 1 Start bit
  • 8 Data Bits (least significant bit transmitted first)
  • 1 Command bit, set on the first character of each datagram.
  • 1 Stop bit

Arduino Serial is reading but ignoring it, so as i think you need to write your own UART code. I didn't delve into this issue myself.

The processor on the Arduno Nano 33 IoT is an nRF52840 (cortex-m4) by Nordic Semiconductor.

Datasheet:
https://infocenter.nordicsemi.com/pdf/nRF52840_PS_v1.7.pdf

It looks to me like the "9-bit" support consists of just the ability to add a parity bit when sending and testing the parity bit when receiving.

Thank you - Yes I can re setup the serial and Fidle with the parity on tx, but so far not able to se how I can read the parity bit ?

Could this be worth a try?

Actually, it probably uses hardware features of AVR chips and not compatible with rf52840/SAMD21...

@johnwasser Is it? Or is that the Nano 33 BLE? Is the 33 IOT based on SAMD21? It's so confusing!

Yes, look:

It's like they are trying to confuse their customers!

The Nano 33 IOT also has BLE... It's the one with the SAMD21 + ESP32.

@fremme please confirm exactly which model of Nano 33 you have. We don't want to waste time finding solutions only to find they are for the wrong type of Nano 33.

Oh for Odin's sake! They use at least three different processors on the Nano, Nano Every, Nano 33 IoT, Nano 33 BLE...

Yes, the Arduino Nano 33 IoT is based on the SAM D21.

The good news is that the SAM D21 chip DOES have support for 9-bit serial. See Section 26 of the datasheet: SERCOM USART

Hello there, and thank you all for your time
Its an Nano 33 IoT I'm using

I do find a few messages from people doing the same as me -
Talking to SeaTalk units , but no one seems to be using the 33 IOT board.
And the published code will not run on a 33 IOT.
If not possible to make it on the IOT , I may be using a non IOT as a serial converter - and then just send/receive in modified format to the IOT.
(Then I could use the example code and modules that seems to be working for others)
But if possible - it would be nice to do it on the IOT :slight_smile:

Im publishing data read from the SeaTalk to a web page on the IOT

If I were going to add 9-bit serial support for the Arduino Nano 33 IoT, I would start by adding 9-bit defines to the existing defines: Arduino15/packages/arduino/hardware/samd/1.8.13/cores/arduino/api/HardwareSerial.h

The harder work will probably be in the Receive Complete interrupt handler, wherever that is.

Thank you everyone , but I just now using a spare MEGA 2560 PRO , and that one is working great in 9-bit serial.
And this MEGA is then sending telegrams to my 33 IOT on normal 8-bit serial format

Starting to read som data and seems to work. Only a few more commands to decode