Hi. I'm using nRF51822, S130, SDK10.0.0. I made a source code as below refering radio_test which is in SDK examples. But the width of frequency is just 0.2MHz as below. As I know, width of 1 channel frequency is 2MHz.
void radio_tx_carrier_test(unsigned char freq_ch) {
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.
}
NRF_RADIO->SHORTS = 0;
NRF_RADIO->EVENTS_DISABLED = 0;
NRF_RADIO->TEST = 0;
NRF_RADIO->TASKS_DISABLE = 1;
while (NRF_RADIO->EVENTS_DISABLED == 0)
{
// Do nothing.
}
NRF_RADIO->EVENTS_DISABLED = 0;
NRF_RADIO->SHORTS = RADIO_SHORTS_READY_START_Msk;
NRF_RADIO->TXPOWER = (4 << RADIO_TXPOWER_TXPOWER_Pos);
NRF_RADIO->MODE = (RADIO_MODE_MODE_Nrf_2Mbit << RADIO_MODE_MODE_Pos);
if(freq_ch>100)
{
if(freq_ch==101) NRF_RADIO->FREQUENCY = 2;
else if(freq_ch==102) NRF_RADIO->FREQUENCY = 40;
else if(freq_ch==103) NRF_RADIO->FREQUENCY = 80;
else if(freq_ch==200) NRF_RADIO->FREQUENCY = 45;
}
else NRF_RADIO->FREQUENCY = freq_ch*2;
NRF_RADIO->TEST = (RADIO_TEST_CONSTCARRIER_Enabled << RADIO_TEST_CONSTCARRIER_Pos) \
| (RADIO_TEST_PLLLOCK_Enabled << RADIO_TEST_PLLLOCK_Pos);
NRF_RADIO->TASKS_TXEN = 1;
NRF_POWER->DCDCEN = 1;
}
int main(void) {
g_freq_ch=101;
radio_tx_carrier_test(g_freq_ch);
while(1)
{
__WFI();
;
}
}
What could be the problem of my source code?
And one more question. As i already asked as below link, devzone.nordicsemi.com/.../ nRF51822 doesn't support non-modulation RF as reply mentioned.
But as you can see, the waveform looks non-modulation frequency. Is this really modulated frequency?
I need your help. Please answer my question.