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.

TM4C1294NCPDT: Broadcast in 9 bit UART mode

Part Number: TM4C1294NCPDT

Hi Folks,

I develop a system, where devices should communicate via RS485. To do this, I want to use the 9 bit mode of UARTs. My question is:

how should I set the address mask the device to listen on its own (e.g.: 2) and the broadcast (0) address?

Regards,

Norbert

  • Norbert,
    Isn't that something you need to implement on your own protocol level? As far as I am aware, there ain't configurations available on hardware level to define uart address.
    In other words, you will listen to the received bytes, and depending on what you read at the address bits, you will decide whether or not to obey such incoming bytes.
    If that's all wrong, I'll be interested as well to learn a bit more on the subject following further replies here.
    Regards
    Bruno
  • Hi Norbert,

     Please use UART9BitAddrSet() to setup address associated with a  slave or a group of addresses using the mask. If you want a slave to receive an address of 2 and also a broadcast address of 0, I think you need to pass ui8Mask with 0xFD and ui8Addr with 0x2.  

    30.2.2.2 UART9BitAddrSet
    Sets the device address(es) for 9-bit mode.
    Prototype:
    void
    UART9BitAddrSet(uint32_t ui32Base,
    uint8_t ui8Addr,
    uint8_t ui8Mask)
    Parameters:
    ui32Base is the base address of the UART port.
    ui8Addr is the device address.
    ui8Mask is the device address mask.
    Description:
    This function configures the device address or range of device addresses that respond to
    requests on the 9-bit UART port. The received address is masked with the mask and then
    compared against the given address, allowing either a single address (if ui8Mask is 0xff) or a
    set of addresses to be matched.
    Note:
    The availability of 9-bit mode varies with the Tiva part in use. Please consult the datasheet for
    the part you are using to determine whether this support is available.

  • Great detail, Charles - thank you. Not all here "welcome" the complexity onslaught of Enet - thus "Multi-Drop" RS485 come close to - but has not (yet) fallen - "Off the cliff."

  • Hi cb1,
    I'm not familiar with RS485. Just forced myself into wikipedia to learn what it is. :-)
  • Oh Charles - I'm NOT that old! (nor is poster Norbert - I'm sure.) RS485 reigned (near) supreme when (8031/8051) MCUs, "Walked the Earth."

    Employing RS485 - past design of mine - regularly & robustly - exchanged data beyond 70 floors - w/in an office tower in NYC.     (Rock Centre)

  • Hi Charles,

    thank you for your replay! I know about the 9bit address API and I have been read trough the documentation. I try to list things that confused me:

    • if the mask is 0xFF: every traffic will be dropped except that match to the address already set. As I understood it, I set the address to 0x2 and leave the mask to 0xFF, I will get interrupt only if address frame is holds 0x2
    • Moreover I didn't understood the mask behavioral: what kind of bool logic can be implemented there, because of the above exact matching

    If I understand your explanation well, the broadcast address (0x0) will be received every time regardless of the address field set in the UART.

    Regards,

    Norbert

  • Hi Norbert,
    Your understanding is correct. Whichever the mask bit is zero, that corresponding address bit can be either 0 or 1. Hope I do this right I think the logic would be something like:

    address_match = (input_address XNOR slave_address) OR (NOT address_mask);