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

Receiving data from GPS L80 with nrf52832 via UART

I am trying to receive data from GPS L80 with the nrf52832 board but I am not able to receive anything. I connected the Rx of nrf52832 with GPS and vice versa. I also connected the grounds of both these devices together. I am hereby attaching my code , Please help me regarding the same.

#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "app_uart.h"
#include "app_error.h"
#include "nrf_delay.h"
#include "nrf.h"
#include "bsp.h"
#include "nrf_uart.h"

NRF_UART_Type uart1;

#define uart1_rx NRF_GPIO_PIN_MAP(0,22)
#define uart1_tx NRF_GPIO_PIN_MAP(0,23)

int main(void)
{
    nrf_uart_enable(&uart1);
    nrf_uart_txrx_pins_set(&uart1, 6, 8);
    nrf_uart_baudrate_set(&uart1,NRF_UART_BAUDRATE_115200);

char UART_RX_BUF[256];
int i=0;
    while (i<256)
    {   
        
        UART_RX_BUF[i] = nrf_uart_rxd_get(&uart1);
        i++;
    }

}

Related