This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

host interface via UART - any examples code for it please?

Hello, support

I use nRF52833 SoC and need to host it with external NXP MCU to control its function, interface is 3 pins only, I wonder whether there is any example code for that please?

And also, I wonder which pins can be used for UART RX and TX. I currently use a nRF52 DK, and pins 5,6,7,8 are used for UART0 to JLink for debug console - I believe. If I need to use another UART, which pins should I use? are pins all configurable to this purpose?

Regards!

Ping

  • Will this be a Bluetooth project?

    If you are using nRF Connect SDK you may check out peripheral_uart.

    Also check out the hci_uart sample. Which one you need depends on your application.

    You might also want to check out the sample shell_bt_nus.

    You may select almost any GPIO as UART. Just make sure the pins are assigned to something else. If you like, I could get back to you later with a few example pins.

    Best regards,

    Håkon

  • Hello, Hakon

    Thanks for reply, this is a real project, which include two products designed with Fanstel BM833 module. Both products are just in market, but they have not had the bluetooth functions developed. One application will be a BLE central, can scan and control other BLE devices, and other will be a peripheral able to be connected by a mobile device to pass configuration data in between etc.

    Both are hosted by NXP MCU via UART ( 3 pin interface), so I need to get the UART talking first. I am new the Nordic and found it hard to turn my head around .  The module on products is Nordic nRF52833 SoC, and I find that it has 2 UARTs, they are wired it to pin 31(RX) and 32(TX) by the hardware guy, I hope it can be configured as either UART0 or UART1? pins are not used for anything else.

    I will have a look on the examples you suggested.

    Regards!

    Ping

  • Hi, Håkon

    I had a look on the hci_uart example, looks like it initiated a UART0  with 4 pin hardware flow control ans seems able to receive and transmit some sort of cmd/data over the UART0 , I have no knowledge of the protocols used here,  may I modify it to use UART1 on nRF52833 with 2 pins without modify the software?

    I am also struggling to interact with it - lost in the ReadMe.lst file, I am a windows user and has been advised to user VS Code so far, if there a way I see it in action?  like with a terminal program? if it use UART0, then it should be able to communicate with Terminal program, what kind of command/messages shall I send to work with?

    Regards!

    Ping

  • Hi Ping

    Sorry for the slow response. Håkon is currently unavailable, and I will help you out in the mean time. 

    PingISTL said:
    The module on products is Nordic nRF52833 SoC, and I find that it has 2 UARTs, they are wired it to pin 31(RX) and 32(TX) by the hardware guy, I hope it can be configured as either UART0 or UART1?

    Yes, you can configure the pins freely in software, and assign either UART0 or UART1 to whatever GPIO's you want. 

    PingISTL said:
    I had a look on the hci_uart example, looks like it initiated a UART0  with 4 pin hardware flow control ans seems able to receive and transmit some sort of cmd/data over the UART0 , I have no knowledge of the protocols used here,  may I modify it to use UART1 on nRF52833 with 2 pins without modify the software?

    You can't change UART configuration without changing the software, no. This is statically configured in the example. 

    PingISTL said:
    I am also struggling to interact with it - lost in the ReadMe.lst file, I am a windows user and has been advised to user VS Code so far, if there a way I see it in action?  like with a terminal program? if it use UART0, then it should be able to communicate with Terminal program, what kind of command/messages shall I send to work with?

    The HCI interface is not designed to be used from a terminal, but if you can configure your terminal in binary (hex) mode it is possible to send and receive some simple commands. 

    Using RealTerm I tried sending the reset command to an nRF52DK flashed with the hci_uart sample, and got a response:

    I haven't read the HCI spec to see what the response means, but if you can get something similar it means the UART communication works. 

    Best regards
    Torbjørn

Related