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

What (uart) example to study to create RS485 on a Fanstel BT832 module? I need to assign TX, RX, DIR on specific GPIO pins.

hi,

The Fanstel BT832 has a nRF52832. It has TX on P11, RX on P12 for standard uart.
I need however rs485 and so need to add a DIR (output) pin. P11 and P12 are not
on the Fanstel castellated pins so I want to re-assing TX and RX as well.

I already looked at project 'uart_pca10040' but have no idea whether this is a good start.
Attached connections diagram. I2C and DIO are extra but the RS485 signals are
the most important.

Thank you.

Fanstel connections.pdf

  • Not sure if I understand your query correctly.

    You can use any GPIO pin available to connect to TX/RX and set the directions accordingly. 

    The Fanstel BT832 has a nRF52832. It has TX on P11, RX on P12

    you can change the pin numbers in the uart_pca10040 example to the pin numbers that suits your design. nRF52 does not have any hardcoded pin numbers for its peripherals.

  • Hi,

    I understand I can change the pins, that is what I need. What I don't have
    is the right source for the currently (shipped) firmware of the Fanstel module.
    I asked Fanstel but have no reply yet. They do provide hexes for the module
    but I need a source so I can implement rs485. I noticed several uart examples
    in the SDK. Which of these would be best to use so I can implement RS485, rebuild
    with SEGGER and use OTA to reprogram the Fanstel module?
    I am a novice to ARM and Bluetooth so I can't figure out which example
    I need.

    regards peter

  • Here's the basics of what you need; please note I can't help in detail. First load the uart demo project, such as nus_eval

    // Define any spare output pin to control the RS485 Drive Enable signal
    #define RS485_DE 4
    // This pin has to be set as an output pin
    
     // Enable RS485 differential driver prior to transmitting a message over the UART
     nrf_gpio_pin_set(RS485_DE);
    
     // In the Uart handler find this case statement and add the driver disable
     case APP_UART_TX_EMPTY: // Event UART has completed transmission of all available data in the TX FIFO
      // Disable RS485 differential driver
      nrf_gpio_pin_clear(RS485_DE);
      break;

    Choose an output pin to control the RS485 direction and set before transmit then clear after the transmit is empty. This is using Nordic drivers, but you can also use low-level uart registers.

    The pca10040 board can be used to test, or test directly on the Fanstel module; A RS485 interface chip is required to generate the differential signals; these are not available on the Fanstel module.

  • hi,

    Sorry for the late reply.

    I have updated the ble_uart example for rs485.

    Do I need to add anything so I can use OverTheAir again once this

    program is programmed into the Fanstel module.

    The Fanstel module firmware supports OTA and that is the only means to program it

    (no access to other pins)

    Can I attach a zip file with my updated ble_uart code?

    regards peter

  • hi,

    Sorry for the late reply.

    I have updated the ble_uart example for rs485.

    Do I need to add anything so I can use OverTheAir again once this

    program is programmed into the Fanstel module.

    The Fanstel module firmware supports OTA and that is the only means to program it

    (no access to other pins)

    Can I attach a zip file with my updated ble_uart code?

    regards peter

Related