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.

UART Communication between two Tiva C

Hello,

I want to communicate between two tiva c series launchpad (TM4C123GXL & TM41294XL) via UART link. Suggestion Please. 

Regards,

Nazmul

  • Hi,

       If you wire the RX, TX, and GND line correctly and have the appropriate code at both launchpads, it should work.

    - kel

  • Hi,

    Thanks kel

    Yes, it works. 

    -Naz

  • While it "works" for now you have limited yourself to just 2 devices.  That's unlikely to satisfy all of your future needs.

    To extend UART operation beyond just 2 devices - it's normal/customary to employ a line driver - and operate via RS485 which enables, "multi-drop."  Weakness of this method is the requirement for RS485 line drivers @ each/every one of your MCU "links."

    Both of the above are asynchronous communication links - demand tight frequency control @ each/every link.  Over time, temperature, MCU voltage variation, device aging - communication may become "spotty."

    Alternatively, clocked serial - I2C or SPI - embed the clock signal w/in the link - thus are often more robust.  And avoid the requirement for line drivers - and may extend to multiple devices.  I2C/SPI are not as "long range" (perhaps meter or two) as RS485 (thousands of feet) and - much to your advantage - both are supported with numerous accessory ICs (display, memory, DAC, ADC, GPIO extension etc.) which makes their use very much worth your consideration...

  • Actually i need to communicate between these two boards about 30+ meters distance. That's why i choose UART (RS485) of Tiva.

    Thanks for reply. 

  • That 30+ meters does force you into RS422/485. 

    Yet - while vendor's MCUs include UART - RS485 (to best of my knowledge) demand separate line drivers.  (same holds for all other ARM MCU vendors...)

    You may find it best to employ the most complete UART port - on each end.  (by complete - I mean a port which includes many of the normal/customary modem control signals)  Stickiest part may be "switching of the RS485 transceiver from receive to transmit."  Best if this can be achieved via some fortunate combination/routing of "naturally occurring" modem signals - not so much if you must, "bit-bang" the RX/TX switch-over...

    Legal trained mind detects your earlier report, "it works" - but doubtful that "works" encompassed those 30+ meters...

  • Hi CB1,

    I tested it with 25 ft (making from two separate cables of 15 ft and 10 ft) twisted pair cable (CAT 5). Baud rate was 115200. Successfully message transfer between these boards. With a single cable it is possible to transfer around 30+ ft, i guess. Sorry in my previous comment i told you unit in meter. But i need actually 30+ ft.

    May be possible with this configuration for meters too with lower baud rate.

     Thanks.

  • Hi Nazmul,

    Certainly 25 - 30 feet is more reasonable - especially if you employ CAT 5 (or better) cable.

    However - that length - unshielded cable - is very likely to "enjoy" antenna effect.  Thus any strong RF signal - or noise impulse - may impact your system.  (the randomness of such "unwanted signal" attack may make fault detection - as well as future diagnosis - difficult)

    Beyond RF penetration - both of your MCUs are now rendered far more susceptible to ESD - which may cause grave damage.  There's a common fix/preventative measure - both for this ESD & earlier RF assault!   Line drivers (RS232 or RS485) are usually far better equipped to handle both induced signal gremlins.  (after all they're designed for such "longer range" hook-ups - your MCU - not so much.)

    All said - and w/these "facts in evidence" I'd vote for your use of RS485 line drivers (each end) as these: protect, extend your range (may well be required, downstream) and accommodate any additional MCUs you may later seek to, "add to this party."  (not to ask "how" I know...)