Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Starting from the beginning with UART

I'm a beginner I'm having hard time understanding UART. 
In my opinion, the documentation is going too straight to the technical details and tutorials without even starting from the beginning.

Is there anywhere a detailed resource explaining what is UART, why using it and how can it be or can't it be used?

The ONLY thing I can find is this answer

As a beginner, I don't want to waste a long time going through all the tutorials about UART and understanding it perfectly before realizing this was actually not for me.
A documentation should provide these very simple information right from the beginning so users can understand if this technology can fit their needs and if this is worth digging in or not.

So let's start:

Håkon says in his answer "You should look into proprietary services more in detail, because that's what NUS is." but if I search for "BLE proprietary services" on Google I could find absolutely nothing. Anyone has something to share about it so I can look into it more in details? Thank you

About what is UART and why it has been created?
There's nothing in the documentation about it. So here is a short summary based on Håkon Alseth's answer:
The Nordic UART Service is a proprietary bluetooth service created to extend the adopted profiles and services from Bluetooth SIG.
That's all I understood, that's short but at least we have something. Any useful information to add?

The BIG questions now:

It can very well be 4 write characteristics, and 2 notify characteristics, but that will be overkill for UART communication 
So in which scenarios does it make sense to use UART? When is it considered overkill or not?

This is one of the proprietary profiles that we have included in our nRF5x SDK, and it is provided with support both on the nRF side, as well as the central side (Android/PC/iOS)
This is where I'm really lost and I wish I could find more information. In simple words what does that mean? What are the limits of using UART?

For example can I use UART with Web Bluetooth?
If the answer is yes, then is it possible but not really advised? Not easy? (at the end it's only BLE right?)
Are there any resources available explaining how to use UART with Web Bluetooth?

Thanks for all your answers and sorry if my questions may seem stupid.
As a beginner, I really feel the nRF world is only made for experts with almost no introduction/presentation of the basic concepts first.

PS: I'm using the nRF 51 DK, I don't know if that makes a difference for the answer about UART + Web Bluetooth

EDIT: Just as additional information, I already tested the ble_app_uart 

  • I would start by making a distinction between UART and NUS (Nordic UART Service). UART is a physical circuit, which main purpose is to send and receive messages between two devices. Transmitted messages goes out of the TX pin and incoming messages goes into the RX pin.  NUS is a proprietary BLE Service, its structure is similar as the UART, as it includes the two characterstics TX and RX. A message is transmitted from the application (server) implementing the service by notifying the value in the TX char, in which the peer (client) will receive. A peer can write to the RX char., and the application will receive the message.

    Both NUS and UART consists of two “channels” TX and RX, and enables simple communications between two devices.

    It is quite easy to “bridge” communication over UART, to communication over BLE NUS, due to their similar structure.

    The ble_app_uart peripheral example, implements the the NUS Service, and allows you to connect and communicate to a client. The client can be another nRF5x device (with the ble_app_uart central example) or a phone. The application will “convert” the messages written into the RX char. and send it over UART, and notify a value change of the TX char. to the client, when it receives messages over UART. The image below illustrates the communication flow if you connect the application to a computer through UART.

    *"Service" should be "server"

    There exist many other possibilities:

    • phone←(BLE) →device←(UART)→computer
    • computer←(UART) →device←(BLE) →device←(UART) →computer
    • device←(BLE)→device  
    • device←(BLE)→phone
    • It is also possible to communicate one-to-many, by exploiting the possibilities of the nRF52 of maintaining several links simultaneously

    NUS/UART can be useful if your application requires wireless low energy communication between two or many devices and if you would like an UART interface to your computer. The communication throughput and range are of course restricted by BLE.

  • Sorry for the very late reply, I haven't had time to come back on this for a long while. Just found a bit of time only very recently.

    Thanks for this awesome answer, as a beginner this is exactly the kind of information I was looking for.

    I know UART seems to be a basic knowledge for experienced developer so I appreciate you took the time to explain it to me and the difference with the Nordic UART Service.

    It's much clearer to me now.

    Thanks again!

  • I am happy to help, and I am glad I made you wiser. Please ask if you have any more questions.

    Best regards,

    Simon

Related