Hi everyone! I'm trying to generate a modulated continuous signal in a specific channel using nrf52832. I used a code made from radio_test example that follows. The problem is that at the laboratory I'm contact with they couldn't find any signal, I don't have an osciloscope to try it, so I wanna know if it's possible to see by debbuging in Keil if it's sending something. If someone see a problem in the code or have any advise I'm greatful. Thanks.
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include "bsp.h"
#include "nrf.h"
#include "radio_test.h"
#include "app_uart.h"
#include "app_error.h"
#include "nordic_common.h"
typedef enum
{
RADIO_TEST_NOP, /**< No test running. */
RADIO_TEST_TXCC, /**< TX constant carrier. */
RADIO_TEST_TXMC, /**< TX modulated carrier. */
RADIO_TEST_TXSWEEP, /**< TX sweep. */
RADIO_TEST_RXC, /**< RX constant carrier. */
RADIO_TEST_RXSWEEP, /**< RX sweep. */
} radio_tests_t;
#define BELL 7 // Bell
#define UART_TX_BUF_SIZE 512 /**< UART TX buffer size. */
#define UART_RX_BUF_SIZE 1 /**< UART RX buffer size. */
void uart_error_handle(app_uart_evt_t * p_event)
{
if (p_event->evt_type == APP_UART_COMMUNICATION_ERROR)
{
APP_ERROR_HANDLER(p_event->data.error_communication);
}
else if (p_event->evt_type == APP_UART_FIFO_ERROR)
{
APP_ERROR_HANDLER(p_event->data.error_code);
}
}
/** @brief Function for configuring all peripherals used in this example.
*/
static void init(void)
{
NRF_RNG->TASKS_START = 1;
// Start 16 MHz crystal oscillator
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK->TASKS_HFCLKSTART = 1;
// Wait for the external oscillator to start up
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
{
// Do nothing.
}
}
/** @brief Function for main application entry.
*/
int main(void)
{
while(true) {
uint8_t txpower = RADIO_TXPOWER_TXPOWER_0dBm; // 0 dBm
uint8_t mode = RADIO_MODE_MODE_Nrf_2Mbit; // 2 MBit mode
uint8_t channel = 40 // Transmit at channel 40
int delayms = 10;
init();
radio_modulated_tx_carrier(txpower, mode, channel);
}
}
/** @} */