This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Nrf51822 with Modbus(TTL to RS485)

I am trying to send and receive a response from a machine using  Modbus (TTL to Rs485) and nrf51822.

Connections: R0 -> RX(P0.11) ,D1->TX(p0.09), RE&DE->P0.19,VCC->5V 

Just the same as to connect with Arduino (Have implemented with Arduino mega)

I am using Keil for programming and trying to send and receive in hexadecimal format, but I am not sure if even command is transmitted and obviously I am not getting any response.

I am not sure about connections also. Attaching code.

Please let me know where I am wrong.

  • Hi

    Please note that according to the nRF51822 product specification, the nRF51822 will not accept more than 3.6V. Please try reducing the voltage to 3.6V or lower, and see what happens. 

    Best regards,

    Simon

  • Tried, only 3.3V supply...not working.

  • Hi

    Can you try describing your issue in more detail? Please make sure that the TX and RX pins are connected correctly to both devices. If you're not sure about your connections, please share your hardware setup (schematics and a high-res picture of your setup) and I will take a look.

    I suggest you try to get it working with our UART example before making any changes to the code. Just to see that you're able to get it running.

    Best regards,

    Simon

  • I tried the UART example with USB to TTL and its working fine. 

    Connections as per I have written are correct, I don't know if I need to connect RTS and CTS. The problem is NRF51 is not communicating with RS485, I am sending hex code but not getting a reply. I am pretty sure I am not messing connections.

  • How did you test that the USB to TTL worked? Are you able to make the nRF51 and RS485 communicate if you don't transmit hex code? The RTS and CTS lines will be necessary if you're using hardware flow control in the UART communication.

    Please add any further information that might help to narrow down the cause of this issue.

    Best regards,

    Simon

1 2