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.

CC2640R2F: How to implement RS485 on CC2640R2

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640, , LAUNCHXL-CC2650, LAUNCHXL-CC2640R2

Dear Experts

Do you have any example code to implement RS485 on CC2640R2?

Thanks for your comment.

  • Hi Jefferey,

    RS485 is just the physical interface, so you need some kind of RS485 driver IC to drive the actual communication lines. The data transfer is application specific, but you can for example use UART. You can for example take a look at the SPP examples here: github.com/.../cc2650lp . These are made for the CC2640, so they will have to be ported to the CC2640R2F SDK. There are instructions for that in the Software Developer´s Guide which is included in the SDK installation.

    Cheers,
    Fredrik
  • Dear Fredrik

    Most of RS232 & RS485 firmware are the same except RS485 need to handle half-duplex.
    If there is any existing RS485 firmware, it will be easier for my customer.
    Otherwise, they may need to spend time to modify it.
    So do you have an example with half-duplex for RS485 exactly?
    Thanks for your support.

  • Hi Jefferey,

    We have UART example available here:
    dev.ti.com/.../

    Beyond that, we do not have anything specifically for running half-duplex communication over a RS-485 physical interface.

    Regards,
    Fredrik
  • Dear Fredrik

    The link you propose is UartEcho.
    My customer tried this driver program successfully some weeks ago.
    It only receives a byte from UART RXD input, CC2640R2 LaunchPad then echos this byte to UART TXD pin.
    And it has no relationship with BLE and could not relay the byte got from RXD to a mobile phone APP.
    Nor it could receive a byte from mobile phone via BLE of 2640R2 and send to UART TXD pin.

    That is, it only does the following:
    CC2640R2 LaunchPad <-- UART RXD <-- MCU
    CC2640R2 LaunchPad --> UART RXD --> MCU

    Hope to have a firmware that can do the following communications:

    Mobile Phone APP <-- BLE <-- CC2640R2 LaunchPad <-- UART RXD <-- MCU
    Mobile Phone APP --> BLE --> CC2640R2 LaunchPad --> UART RXD --> MCU

    Do you have any comment on this?
    Thanks for your support.

  • I suggest you to use spp_ble_client/spp_ble_server example for LAUNCHXL-CC2650 but you have to porting the examples to LAUNCHXL-CC2640R2.