This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x interfacing a 9-bit UART protocol

I am investigating ways to interface a AM335x with a 9-bit serial protocol. I am aware that the AM335x does not support  support 9-bit data through the UART hardware. Our board will be Linux as an OS. 

The protocol I wish to implement is an Multi-Drop Bus protocol. The AM335x master side needs to be able to set the 9th bit on the first byte of every transmission (This is the address byte).  All of the following bytes do not have the bit set.  When receiving bytes only the last byte will have the 9-bit set. The AM335x will only be used on the master side of this protocol.  

I'm thinking there are a few ways of doing this:

1) Emulate the 9-bit serial using the mark and space parity settings.  

Something similar to this: http://www.lothosoft.ch/thomas/libmip/markspaceparity.php

2) Use a modified version of the Software UART firmware in the PRU that is provided by TI. This seems like it would work  but I am unsure of the amount of work involved. Plus it has the overhead of learning to write assembler for the PRU. 

http://processors.wiki.ti.com/index.php/Soft-UART_Implementation_on_AM335X_PRU_-_Software_Users_Guide

3) Use a small micro that is capable of 9-bit serial as a converter. I understand what this entails and it seems less like a hack then the other two methods. However I would like to avoid having to add hardware components to the project  if possible.

Anyone have any experience or thoughts on trying to accomplish this? 

  • Hi Cyril,
     
    It seems to me that the first option will be easiest to implement. Only software involved.
  • Hi Cyril Moore

    I am facing the same issue.

    For first bye (address byte), 9th bit is MARK.

    and other data it is SPACE. 

    Using this combination.

    9th bit             UART_LCR[5]                UART_LCR[4]                UART_LCR[3]

    =====            ============             ============              ============

    (Forced 1)         1                                             0                                   1

    (Forced 0)         1                                             1                                   1

    But it is observed on scope that 9th bit remains '0' for all data.

    Will yopu please assist me to solve this problem.

    Thanks in Advance.

    Regards,

    Ankit

  • Hello, 

    I need do the same, UART 9 bit multi-drop, RS485. 

    I think 3 same solutions that you:

    1. Software playing with parity:mark/space. I tried this, no good.

    2. UART on PRU

    3. external cpu to do this.

    I would like know that you finally do, thanks.

    Raúl