This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Reason for no Bluetooth signal?

I'm trying to finish a handmade custom board I started. I had previous problems with the crystals, and a few others, but right the thing seems to be working ok. At least I checked with UART that the board is running the hole code. I'm trying a simple Beacon example. But with the nRF Beacon application for Android I'm not seeing any signal. Even with the telephone touching the board. The board has a nRF51822FAAG0 with the balun BAL-NRF01D3, and a Johanson 2450AT43A100 chip antenna. I'm really lost here, I have a series of reasons in mind why the Bluetooth signal it's measing:

  1. A soldering problem with the balun. I had resolder the compoment a couple of times, I'm almost sure that it's in his right position, but it's very tricky to solder.
  2. The shunt capacitor of the antenna. I have a 1.5pF capacitor there, when the recommended it's 0.8pF. I'm trying to get the 0.8pF one.
  3. The 16Mhz crystal. I have this crystal with 18pF capacitors with 5% tolerance (the crystal load capacitance is CL = 12pF). The frecuency tolerance it's ok? Really don't sure because the datasheet it's not very clear.
  4. The design of the board and the code used it's from the OpenBeacon proyect. So, it's suppose to be a working proyect.

Can you help to understand where can be the problem? What can I try next? Thank you so much.

I leave here the schematics of the board, and a Photo of the proyect. image description image description

Update: And also the scope of the VDD_PA I got. image description

OpenBeacon.PDF OpenBeacon2.PDF

UPDATE: This is the code of my advertisment function.

static void radio_send_advertisment(void)
{
	const TMapping *map;
	int My_tasks_txen;

	/* transmit beacon on all advertisment channels */
	map = &g_advertisment[g_advertisment_index];

	/* switch frequency & whitening */
	NRF_RADIO->FREQUENCY = map->frequency;
	NRF_RADIO->DATAWHITEIV = map->channel;

	/* BLE header */
	g_pkt_buffer[0] = 0x42;

	/* add MAC address */
	g_pkt_buffer[2] = (uint8_t)(g_uid>>24);
	g_pkt_buffer[3] = (uint8_t)(g_uid>>16);
	g_pkt_buffer[4] = (uint8_t)(g_uid>> 8);
	g_pkt_buffer[5] = (uint8_t)(g_uid>> 0);
	g_pkt_buffer[6] = 0;
	g_pkt_buffer[7] = 0;

	/* No BT/EDR - Tx only */
	g_pkt_buffer[8] = 2;
	g_pkt_buffer[9] = 0x01;
	g_pkt_buffer[10]= 0x04;

	/* append beacon packet */
	g_pkt_buffer[1]= BLE_PREFIX_SIZE+g_beacon_pkt_len;
	if(g_beacon_pkt_len)
		memcpy(
			&g_pkt_buffer[BLE_POSTFIX],
			g_beacon_pkt,
			g_beacon_pkt_len
		);

	/* set packet pointer */
	NRF_RADIO->PACKETPTR = (uint32_t)&g_pkt_buffer;

	NRF_RADIO->EVENTS_END = 0;

	/* start tracker TX */
	NRF_RADIO->TASKS_TXEN = 1;
	My_tasks_txen = NRF_RADIO->TASKS_TXEN;
	debug_printf("\n\rTasks_TXEN = %d\n\r", My_tasks_txen);
}

void POWER_CLOCK_IRQ_Handler(void)
{
	/* always transmit proximity packet */
	if(NRF_CLOCK->EVENTS_HFCLKSTARTED)
	{
		/* acknowledge event */
		NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;

		/* start advertising */
		radio_send_advertisment();
	}
}
  • Hi Daniel,

    Your loading caps on the 16M looks to be correct.

    Cload = 2*CL - Cpcb - Cpin = 2*12 - 4 - 2 = 18 pF
    

    The frequency tolerance is also given to 30 ppm in room temperature, but it might be out-of-spec for a wider temperature range. However; this should not give you huge problems with using the radio, it's more of a problem if/when you bluetooth certify the product.

    You can easily test if the nRF has issues starting up the 16M xtal by running this loop:

    NRF_CLOCK->TASKS_HFCLKSTART = 1;
    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0); // add a breakpoint after this
    

    The same procedure can be done for your 32k XTAL as well. Note that all BLE examples uses an external 32kHz source by default. You can change this to using the internal RC by calling:

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, NULL);
    

    Have you checked if your code is running? Can you set breakpoints etc.? Even though your BALUN is not properly soldered, you should get some centimeters of range. Try placing your phone close to the beacon and see if you pick up something.

    Cheers, Håkon

  • Thank you for your answer Håkon! I had tested the xtals already. Exactly whit this code:

    /* start 32kHz crystal oscillator */
    	NRF_CLOCK->LFCLKSRC =
    		(CLOCK_LFCLKSRCCOPY_SRC_Xtal << CLOCK_LFCLKSRCCOPY_SRC_Pos);
    	NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    	NRF_CLOCK->TASKS_LFCLKSTART = 1;
    	while(!NRF_CLOCK->EVENTS_LFCLKSTARTED);
    

    And the 16 Xtal in this interrupt handler (I'm sure its getting inside the if because I sended a uart printf at that point)

    void POWER_CLOCK_IRQ_Handler(void)
        {
        	/* always transmit proximity packet */
        	if(NRF_CLOCK->EVENTS_HFCLKSTARTED)
        	{
        		/* acknowledge event */
        		NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
        
        		/* start advertising */
        		radio_send_advertisment();
        	}
        }
    
  • I have checked that the code is running. I really can't use breakpoints, I think that is beacuse I'm using the ST-link programmer in a STM32 discovery board to programme the nRF51822. But anyway I can debbug the code, follow the commands one by one, and I receive uart messages in my computer, so the code is running for sure (Also the leds blinks every 5 seconds!). So, I'm getting a little nervous here. Why I can get any Bluettoth signal? I toke off the protection of my phone and touched the beacon, and nothing. No signal. I'm getting a little nervous. If what you say it's true the problem must be in the code, but I'm using a board with its original code. I gest I will need to try to adapt the code of a Nordic beacon example. I just always get a little confuse with the code. Note that the code I'm using don't use the softdevice. Any other idea?

  • Hi Daniel,

    You could scope the "VDD_PA" pin (pin 30) to see if this goes high. If it does, it means that the radio is actively sending data over-the-air. If you download the latest nRF51 SDK v10, there are precompiled .hex files for each project, which have the softdevice merged in. Could you try one of these to see if it starts to advertise?

    Cheers, Håkon

  • I had download the SDK 10. I tried to load one .hex file, following this instructions (1, 2) but without success. Keil it's asking me the .elf file. Any idea what I'm doing bad? Today in the afternoon I will try to look at the pin 30 with a oscillograph. Thaks for you help.

Related