9-bit UART decode for multidrop RS-485: the ninth bit tells an address from data

Suggested by Sorama on the EEVblog forum. Thank you!

built, being checked on real hardware · MHO900, DHO800/900
Ninth bit read

The video is NovaOS's screen on its built-in test signal of a multidrop bus.

What's new

Ninth bit readA:12 for an address, the value for data
Message tableAddress, byte count and data, one row a message
Address triggerA capture starts on one slave's address byte

How it works

Ninth bit read

Decode has a 9-bit UART decoder among NovaOS's own (UART9). A character is a start bit, 5 to 8 data bits, the address bit and 1 or 2 stop bits: 11 bits with eight data bits and one stop bit. Address bit sets which value marks an address: 1, as on most multidrop buses and in the 9-bit modes of the 8051, AVR and STM32 UARTs, or 0. In the lane an address reads A:12 and each data byte its value, in hex, decimal, binary or ASCII.

Message table

The event table has a row per message: the slave's address, how many bytes followed it, and the bytes (Bytes shown sets how many, up to 256). A capture that starts inside a message shows its first bytes with no address, and a stop bit at the wrong level is marked as a framing error. Over SCPI: :NOVAos:BUS1:MODE UART9, :NOVAos:BUS1:UART9:ADDRess ONE or ZERO, BAUD, DBITs, SBITs, POLarity, and :NOVAos:BUS1:DATA? for the table.

Address trigger

Copy trigger sets the RS232 trigger to the byte in Trig. addr, at the decoder's rate, polarity and threshold, so a capture starts on traffic to that slave. The trigger hardware compares the eight data bits and not the address bit, so it also fires on a data byte of the same value: measured on our MHO934 with its generator playing 9-bit characters at 9600 b/s, the trigger on 34 fired on 34 as an address five times out of five, on 34 as data five out of five, and never on 35.

Where it stands

  1. DoneThe decoder

    UART9 on Decode's NovaOS row, on both families: address bit 1 or 0, 5 to 8 data bits, 1 or 2 stop bits, normal or inverted line, the lane and a row per message, and its SCPI commands.

  2. DoneChecked on test signals

    A master addressing slave 0x12 with 01 02 03 and slave 0x34 with A5 5A decodes into those two messages on the DHO and the MHO, over SCPI and on the screen; the same line read with address-when-0, seven data bits with two stop bits, a framing error, a capture starting mid-message and an inverted probe are checked too.

  3. DoneThe address trigger, measured

    Our MHO934's generator played 9-bit characters at 9600 b/s into CH1 with the RS232 trigger on the byte 34: it fired on 34 sent as an address (5 of 5) and on 34 sent as data (5 of 5), never on 35 (0 of 5). So the trigger finds the slave's address byte but also any data byte of that value; the decoder's table still tells the two apart.

  4. NextOn the scopes

    It reaches the scopes with the next release.

  5. Waiting on the hardwareA live RS-485 bus on our bench

    Two microcontroller boards with RS-485 transceivers, a master addressing a slave that answers, decoded on the scope at 9600, 19200 and 115200 b/s, with the address trigger checked on the live bus. The boards' firmware is written and built; we are waiting for the boards to arrive.

  6. NextA trigger on the address only

    A trigger that skips data bytes of the address's value: after the hardware trigger fires, NovaOS checks the ninth bit of the character it fired on and re-arms when it marks data.

What we need from you

What Sorama asked for

A UART decoder that reads the ninth bit: an address when it is 1, data when it is 0; Eleven bits a character: start, eight data bits, the address bit and a stop bit; One master talking to several slaves on one bus: each message is an address and the data that follows it; Multidrop RS-485 buses of embedded systems decoded on the scope, their MHO98.

I’m still looking for a scope/decoder that can decode UART 9 bit where a certain bit (ninth) indicates the packet is an address when 1, and data when 0.
(11 bits in total).
1 master, multiple slaves (point to multipoint).
This because I often need to serial decode multidrop RS 485 embedded systems.

Try it and tell us what to change: reply on NovaOS's thread on the EEVblog forum.