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

Sensor Readings using UART

I am trying to use a sensor that needs 9600 baud rate with the nRF52840-DK. I've set the baud rate to 9600 on the sdk_config.h. Would I still be able to see the transmit/receive data on putty if the baud rate is set to 9600 for the sensor and the DK runs on 115200? At the moment, I can only see things on putty if the baud rate is set to 115200 and it's just basically the DK talking to itself.

I'm having trouble with getting any responses from the sensor, both from the custom PCB and just connecting the sensor to the assigned GPIO pins on the DK. I am able to send commands to the sensor ie "Z\r\n" (I think) but I am not getting the right response back from the sensor. In this case, the temperature reading. 

I'm using the SDK 15.2 and started off with the UART example (UART library).

What am I doing wrong here?

Parents Reply Children
  • Sorry, I'm really a bit clueless over this. I've created the two instances, assigning different sets of GPIOs and different baud rate (115200 for DK instance and 9600 for sensor instance).

    I can see data transmitted/received on putty coming from the DK but how do I get the data received from the sensor? I'm using app_uart_get() and app_uart_put() to send and receive data and it seems like I can only communicate with the DK. There's no way to specify which instance I want to receive/transmit data from. Am I meant to use a different function? Or are the same data/commands being sent to the different UART instances?

    I just want to get the readings from the sensor but I don't know how to access that.

Related