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

Simple program that receives/sends hex strings via UART port. Please help.

I'm totally new to Nordic solutions. I was programming a lot in assembler in 8051 era 20 years ago. Now I feel lost in that new solutions.

I have PCA10040. It is connected as COM6. I use SEGGER Studio.

I try to write a simple program, that sends and receives short, max 8 bytes data via com port with standard speed 9600.8.N.1

All what I need is to:

- when data is received, then start function, where I can decide what to do with "case" function

- When I need to send something, just to have simple "send_to_uart" or similar function.

All as simple as possible. 

Please help me with such "Hello Uart" program. Our company wants  to switch to Nordic, but my lack of knowledge causes delay.

In older times it was easy - just write parameters of com speed to registers, reserve buffer, init port, and voila - it was working.

Tom

  • Hi Tom,

    I'm happy to learn that you are evaluating Nordic. I'm sure you will find a lot to like once you learn how the different parts are connected.

    We have a lot of drivers, libraries and examples to help you get started. For the nRF52832 (PCA10040) I recommend you download nRF5 SDK 15.0.0 which contains project files for SEGGER Embedded Studio. You can find documentation in our Infocenter. If you are looking for more specific documentation regarding a particular function or a structure you can find it in the .h files.

    For your specific application I recommend you take a look at the UART Example. If you would like to combine BLE with UART you may check out the UART/Serial Port Emulation over BLE Example. If you prefer to work with a more low level library you can check out the Serial Port Library.

    It might also be helpful to skim through the nRF5 Getting Started documentation to get an overview.

    I hope this is enough to get you started. Welcome to DevZone and don't hesitate to ask further questions. Also, if you search DevZone you will find many questions and answers by both professionals and amateurs.

    Ketil

Related