9-bit UART frames and data radio

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi again everybody! Hopefully someone has some sage advice:

 

So I am using ATMega324PBs with a master and several slaves chained together using the UART and multi-MCU mode. This entails using 9-bit serial frames and the MCMCU bit to mask data that is not intended for that MCU, and also to delineate packets. 

 

This has been working great, but now instead of direct connection, I need to send the UART data over the air. To do this my boss found this part: HM-TRP FSK Transceiver https://www.rcscomponents.kiev.ua/datasheets/HM-TRP_433.pdf. However, it has a major problem: it only supports 8 data bits and one stop bit. This doesn't fit my 9 bits, and I get garbage data because of it. 

 

So what I'm looking for is a drop-in data radio that I can connect to my TX and RX pins and have it transfer the 9 data bits and 1 stop bit. Does anyone know of a product like this?

 

P.S. I am also looking at the LoRa radios, but I am not really familiar with them. Do the ones with a UART interface (as opposed to the SPI units) work as drop-in UART transceivers?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

LoRa radios are limited to 8 bit data BUT you can address individual nodes in a network, so the radios do that part for you. The packet overhead can be quite large for small size packets. The data rate can be very low (in the 100s of bits per second or less), but also a lot faster, trading speed for distance. These don't really work as drop-in UART replacers because of all the overhead (yes, it can be set up before hand, but you still have to do stuff that you don't do with a UART - some 50+ registers worth).

 

The Semtech ones only offer I2C or SPI interfaces. Don't know about the others.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Thu. Jun 8, 2017 - 06:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dtreth@gmail.com wrote:
So what I'm looking for is a drop-in data radio that I can connect to my TX and RX pins and have it transfer the 9 data bits and 1 stop bit. Does anyone know of a product like this?
No

An alternative is RF Digital RFDP8 at 9600bps 8N1 UART that has a network mode.

The network is not adhoc as each node has to be married.

The network is free form (star, peer-to-peer, linear, etc) and can have hops to increase range (RFDP8 is 2.4GHz)

RF Digital

http://www.rfdigital.com/

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

Ditch the 9bit and modify your protocol to use 8 bit.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I figured this was the answer, but I just wanted to have nice things. Why does the world hate 9-bit? It's so useful.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In UART usually the reason you use 9 bits is so that you can use that extra bit to say "the following 8 are either the address of a node or they are data". So when you want to switch the target the data stream is being sent to you set the 9th bit and then set hte other 8 to be the address of the node that should now become active. You aren't actually using 9 bits to convey 9 bits of data.

 

Presumably on a radio network the way you address one particular station presumably has its own mechanism? So all you really need to change is in the code that is sending the data when you were previously using the 9thbit+address mechanism now you call some kind of radio_stack_set_target_address(addr) instead. Otherwise the 8 bit data stream stuff remains the same.

Last Edited: Fri. Jun 9, 2017 - 11:31 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dtreth@gmail.com wrote:
Why does the world hate 9-bit? It's so useful.

You've discovered the reason why! Back in the early 90's I used it as did some other products I worked with. The problem emerges when you want to talk to other things - in my case it was PCs. Debugging is also a pain. Apart from that, it works well.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Agree with the others that 9-bit is specifically designed for UART links - so, if you're moving to radio, the addressing is probably best done in the radio protocol.

 

Atmel Microchip have AVRs (and Cortex-M) with integrated radios - perhaps you could use one of them, and do away with the UART completely ... ?

 

I am also looking at the LoRa radios, but I am not really familiar with them. Do the ones with a UART interface (as opposed to the SPI units) work as drop-in UART transceivers?

The MultiTech xDot and mDot use an STM32, in which you can add your own code. I'm pretty sure the STM32 can do 9-bit multi-processor on its UARTs ...

 

http://www.multitech.com/brands/...

 

http://www.multitech.com/brands/...

 

However, with the STM32 available to you, why would you need an AVR ... ?

 

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's not that the world hates 9 bit, it's just that 5-6-7-8 bit has been around much longer so more "things" are compatible.  

Suggest as before, moving to 8 bit.   Look for a compatible protocol to handle your needs, take a look at S.N.A.P as one possible solution, usable on many media.

http://www.hth.com/snap/

 

Jim

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Of course there in nothing wrong with using 8 bits MPCM, the only problem being that you need to send 2 bytes per payload byte (ie split every byte into 2x4 bits).

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the reply and the consideration. If you take a look at that radio I have there, it's just an FSK transceiver; it takes the bytes I send and dumps them into the RF. There's no address to set. I'm actually using them to piggyback onto an existing fiber star network to send diagnostic data from all the endboints, so the entirety of the addressing mechanism is being handled by me on the AVR.
I can obviously re-architect everything, but I was really (probably unrealistically) hoping for a drop-in replacement, or something requiring the least modification.
I'm leaning towards COBS and using the zero byte as a signal. But I'd be open to using a radio that could be dropped onto the AVR UART that works like the one you're describing, if you know a part.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Versus RF Digital RFDP8, the following has a range that's an order of magnitude greater with an order of magnitude greater transmit current consumption :

Linx Technologies

Linx Technologies

HumPRO-ATM Series Long Range RF Transceiver Module

https://linxtechnologies.com/wp/product/humpro-a-series-long-range-rf-transceiver-module/

Long Range, Pre-Certified 900MHz Transceiver

Its module guide states routing is done by the host MCU; it has Linux, macOS, and Windows code so the network's gateway should have a nearly arbitrary network size (number of nodes)

Though not MPCM, the module has a UART interface with three addressing modes.

 


https://linxtechnologies.com/wp/p/rf-modules/wireless-uart-rf-modules/

https://linxtechnologies.com/wp/support/software-drivers/ (search for HumPRO)

http://www.mouser.com/new/linx/linx-humpro-a-transceiver/

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:
The Semtech ones only offer I2C or SPI interfaces. Don't know about the others.
SPI for HopeRF LoRa transceivers with Arduino source code.

Payload contains an address byte (preamble, sync, payload, CRC)

Application and network crypto is done by the MCU connected to the transceiver.

 

http://www.hoperf.com/rf%5Ftransceiver/lora/

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dtreth@gmail.com wrote:
P.S. I am also looking at the LoRa radios, but I am not really familiar with them. Do the ones with a UART interface (as opposed to the SPI units) work as drop-in UART transceivers?
No for Microchip RN2483.

There's a port for each address (akin to Internet Protocol)

Microchip

RN2483 LoRa® Technology Module Command Reference User’s Guide

http://ww1.microchip.com/downloads/en/DeviceDoc/40001784F.pdf

(page 23)

2.4.2 mac tx <type> <portno> <data>

http://www.microchip.com/wwwproducts/en/RN2483

 

"Dare to be naïve." - Buckminster Fuller