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

Sending constant carrier

Hi, I want to send a constant carrier during production testing of a product. First I call sd_softdevice_disable(); then I do the following:

        //Restart radio
		NRF_PPI->CHENCLR = PPI_CHENCLR_CH0_Msk | PPI_CHENCLR_CH1_Msk;

		NRF_RADIO->SHORTS          = 0;
		NRF_RADIO->EVENTS_DISABLED = 0;
		NRF_RADIO->TASKS_DISABLE   = 1;

		while (NRF_RADIO->EVENTS_DISABLED == 0)
		{
			// Do nothing
		}

		NRF_RADIO->EVENTS_DISABLED = 0;
		NRF_RADIO->TASKS_RXEN      = 0;
		NRF_RADIO->TASKS_TXEN      = 0;


		NRF_RADIO->PREFIX0    &= ~RADIO_PREFIX0_AP0_Msk;
		NRF_RADIO->PREFIX0    |= (0x71764129 >> 24) & RADIO_PREFIX0_AP0_Msk;
		NRF_RADIO->BASE0       = 0x71764129 << 8;
		NRF_RADIO->RXADDRESSES = RADIO_RXADDRESSES_ADDR0_Enabled << RADIO_RXADDRESSES_ADDR0_Pos;
		NRF_RADIO->TXADDRESS   = (0x00 << RADIO_TXADDRESS_TXADDRESS_Pos) & RADIO_TXADDRESS_TXADDRESS_Msk;

		// Configure CRC calculation
		NRF_RADIO->CRCCNF = (1 << RADIO_CRCCNF_SKIPADDR_Pos) |
				(RADIO_CRCCNF_LEN_Three << RADIO_CRCCNF_LEN_Pos);

		NRF_RADIO->PCNF0 = (0 << RADIO_PCNF0_S1LEN_Pos) |
				(1 << RADIO_PCNF0_S0LEN_Pos) |
				(8 << RADIO_PCNF0_LFLEN_Pos);

		NRF_RADIO->PCNF1 = (RADIO_PCNF1_WHITEEN_Disabled          << RADIO_PCNF1_WHITEEN_Pos) |
				(RADIO_PCNF1_ENDIAN_Little             << RADIO_PCNF1_ENDIAN_Pos)  |
				(3              << RADIO_PCNF1_BALEN_Pos)   |
				(0      << RADIO_PCNF1_STATLEN_Pos) |
				(37 << RADIO_PCNF1_MAXLEN_Pos);


		NRF_RADIO->TEST         = 0;
		NRF_RADIO->CRCPOLY      = m_crc_poly;
		NRF_RADIO->CRCINIT      = m_crc_init;
		NRF_RADIO->FREQUENCY    = frequency;                 			 // Actual frequency (MHz): 2400 + register value
		NRF_RADIO->PACKETPTR    = (uint32_t)&package[0];                 // Setting packet pointer will start the radio
		NRF_RADIO->EVENTS_READY = 0;
		NRF_RADIO->TXPOWER = RADIO_TXPOWER_TXPOWER_Pos4dBm<<RADIO_TXPOWER_TXPOWER_Pos;

		NRF_RADIO->TEST = (RADIO_TEST_PLLLOCK_Enabled << RADIO_TEST_PLLLOCK_Pos) | (RADIO_TEST_CONSTCARRIER_Enabled << RADIO_TEST_CONSTCARRIER_Pos);
		NRF_RADIO->MODE=RADIO_MODE_MODE_Ble_1Mbit<<RADIO_MODE_MODE_Pos;

		// Shortcut between READY event and START task
		NRF_RADIO->SHORTS = 1 << RADIO_SHORTS_READY_START_Pos;
		// Shortcut will start radio in Tx mode when it is ready
		NRF_RADIO->TASKS_TXEN = 1;

		//Just wait here, the test jigg will cut power to the unit
		while(1);

I have tried a lot of different settings but every time I just get modulated data. When I compare with a unit loaded with DTM firmware and send a constant carrier I can see that the DTM unit sends a much smaller spectrum but my code sends a gaussian distrubited spectrum which i assume is data beeing modulated.

How do I configure the radio to only send carrier?

Related