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

NRF51 with PTR5518 range problems

Hi friends,

I'm using a NRF51 IC with this 4.0BLE Modul PTR5518 and i have big problems with Range. As a protocoll i use gazell. In air it is possible do get some correct signals up to 6-7 m but that it don't work properly anymore. If you have a human body in between it is a disaster, you only get good signals with a range <1m. Can i somehow approve this? Please help me if you can. I'm very desperate.

Thank you in advance. Tanja

Parents
  • Here the gazell setup code, maybe there is a mistake??

    //The Gazell pipe on which the communication between host and device is carried out. Must be between 1 and 6.
    #define GAZELL_DATA_PIPE                                                                                                                                    (1)
    
    //THE PAIRING PIPE MUST ALWAYS BE PIPE 0, or else the concept won't work!!!
    #define GAZELL_PAIRING_PIPE                                                                                                                               (0)
    
    //Not used on the remote, but kept here for consistency
    #define GAZELL_PAIRING_DATA_STORAGE_ADDRESS                                                                  (0x0003FC00)
    
    //Please read the Flash module description and the documentation of flash_segment_t/struct flash_segment before
    //changing the values of any defines that begin with 'GAZELL_PAIRING_FLASH_'.
    
    #define GAZELL_PAIRING_FLASH_NUMBER_OF_FIELDS                                               (16)
    
    #define GAZELL_PAIRING_FLASH_0_RELATIVE_ADDRESS_DIRTY_BITS    (4)
    
    #define GAZELL_PAIRING_FLASH_0_RELATIVE_ADDRESS_FIELDS                             (8)
    
    #define GAZELL_PAIRING_FLASH_1_RELATIVE_ADDRESS_DIRTY_BITS    (72)
    
    #define GAZELL_PAIRING_FLASH_1_RELATIVE_ADDRESS_FIELDS                             (76)
    
    #define GAZELL_PAIRING_PROCEDURE_TIMEOUT_MS                                                                 (60)
    
    #define GAZELL_MINIMUM_INTERVAL_BETWEEN_PAIR_AND_UNPAIR_MS        (2000)
    
    #define GAZELL_MAX_NUM_STORED_PACKETS                                                                               (8)
    
    #define GAZELL_DEVICE_DUMMY_PACKET_SEND_INTERVAL_10MS                       (5)
    
    #define GAZELL_CHANNEL_TABLE                                                                                                                        2, 8, 12, 18, 22, 28, 32, 38, 42, 48, 52, 58, 62, 68, 80
    
    #define GAZELL_BAUDRATE_KBITPS                                                                                                                    (250)
    
    
    void Gazell_Init(void)
    {
    #if (GAZELL_MODE_DEVICE == GAZELL_MODE)
                    flash_segment_t flashSegmentPairingID0 = {
                                   .bitsPerField = 32,
                                   .numberOfFields = GAZELL_PAIRING_FLASH_NUMBER_OF_FIELDS,
                                   .relativeAddressOfFirstDirtyBit = GAZELL_PAIRING_FLASH_0_RELATIVE_ADDRESS_DIRTY_BITS,
                                   .relativeAddressOfFirstField = GAZELL_PAIRING_FLASH_0_RELATIVE_ADDRESS_FIELDS
                    };
                    flash_segment_t flashSegmentPairingID1 = {
                                   .bitsPerField = 32,
                                   .numberOfFields = GAZELL_PAIRING_FLASH_NUMBER_OF_FIELDS,
                                   .relativeAddressOfFirstDirtyBit = GAZELL_PAIRING_FLASH_1_RELATIVE_ADDRESS_DIRTY_BITS,
                                   .relativeAddressOfFirstField = GAZELL_PAIRING_FLASH_1_RELATIVE_ADDRESS_FIELDS
                    };
    
                    flashSegmentNumberParingID0 = Flash_RegisterSegment(flashSegmentPairingID0);
                    flashSegmentNumberParingID1 = Flash_RegisterSegment(flashSegmentPairingID1);
    
                    pairID[0] = Flash_ReadData(flashSegmentNumberParingID0);
                    pairID[1] = Flash_ReadData(flashSegmentNumberParingID1);
    
                    nrf_gzll_init(NRF_GZLL_MODE_DEVICE);
                    nrf_gzll_set_max_tx_attempts(50);
                    if((pairID[0] != 0) && pairID[1] != 0)
                    {
                                   nrf_gzll_set_base_address_1(GenerateValidBaseAddressFromChipID(pairID));
                                   isPaired = TRUE;
                    }
    #elif (GAZELL_MODE_HOST == GAZELL_MODE)
                    pairID[0] = NRF_FICR->DEVICEID[0];
                    pairID[1] = NRF_FICR->DEVICEID[1];
                    nrf_gzll_init(NRF_GZLL_MODE_HOST);
                    nrf_gzll_set_base_address_1(GenerateValidBaseAddressFromChipID(pairID));
    #else
    #error GAZELL_MODE is undefined or it has some unknown value.
    #endif
                    nrf_gzll_set_tx_power(NRF_GZLL_TX_POWER_4_DBM);
    #if (250 == GAZELL_BAUDRATE_KBITPS)
                    nrf_gzll_set_datarate(NRF_GZLL_DATARATE_250KBIT);
                    nrf_gzll_set_timeslot_period(2700);
    #elif (1000 == GAZELL_BAUDRATE_KBITPS)
                    nrf_gzll_set_datarate(NRF_GZLL_DATARATE_1MBIT);
                    nrf_gzll_set_timeslot_period(900);
    #elif (2000 == GAZELL_BAUDRATE_KBITPS)
    #else
    #error Wrong baudrate selected. Possible values are 2000, 1000 or 250.
    #endif
             nrf_gzll_set_device_channel_selection_policy(NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_CURRENT);
                    generateAndSetChannelTable();
                    nrf_gzll_set_timeslots_per_channel(5);
                    nrf_gzll_set_timeslots_per_channel_when_device_out_of_sync(1);
                    nrf_gzll_enable();
    }
    
Reply
  • Here the gazell setup code, maybe there is a mistake??

    //The Gazell pipe on which the communication between host and device is carried out. Must be between 1 and 6.
    #define GAZELL_DATA_PIPE                                                                                                                                    (1)
    
    //THE PAIRING PIPE MUST ALWAYS BE PIPE 0, or else the concept won't work!!!
    #define GAZELL_PAIRING_PIPE                                                                                                                               (0)
    
    //Not used on the remote, but kept here for consistency
    #define GAZELL_PAIRING_DATA_STORAGE_ADDRESS                                                                  (0x0003FC00)
    
    //Please read the Flash module description and the documentation of flash_segment_t/struct flash_segment before
    //changing the values of any defines that begin with 'GAZELL_PAIRING_FLASH_'.
    
    #define GAZELL_PAIRING_FLASH_NUMBER_OF_FIELDS                                               (16)
    
    #define GAZELL_PAIRING_FLASH_0_RELATIVE_ADDRESS_DIRTY_BITS    (4)
    
    #define GAZELL_PAIRING_FLASH_0_RELATIVE_ADDRESS_FIELDS                             (8)
    
    #define GAZELL_PAIRING_FLASH_1_RELATIVE_ADDRESS_DIRTY_BITS    (72)
    
    #define GAZELL_PAIRING_FLASH_1_RELATIVE_ADDRESS_FIELDS                             (76)
    
    #define GAZELL_PAIRING_PROCEDURE_TIMEOUT_MS                                                                 (60)
    
    #define GAZELL_MINIMUM_INTERVAL_BETWEEN_PAIR_AND_UNPAIR_MS        (2000)
    
    #define GAZELL_MAX_NUM_STORED_PACKETS                                                                               (8)
    
    #define GAZELL_DEVICE_DUMMY_PACKET_SEND_INTERVAL_10MS                       (5)
    
    #define GAZELL_CHANNEL_TABLE                                                                                                                        2, 8, 12, 18, 22, 28, 32, 38, 42, 48, 52, 58, 62, 68, 80
    
    #define GAZELL_BAUDRATE_KBITPS                                                                                                                    (250)
    
    
    void Gazell_Init(void)
    {
    #if (GAZELL_MODE_DEVICE == GAZELL_MODE)
                    flash_segment_t flashSegmentPairingID0 = {
                                   .bitsPerField = 32,
                                   .numberOfFields = GAZELL_PAIRING_FLASH_NUMBER_OF_FIELDS,
                                   .relativeAddressOfFirstDirtyBit = GAZELL_PAIRING_FLASH_0_RELATIVE_ADDRESS_DIRTY_BITS,
                                   .relativeAddressOfFirstField = GAZELL_PAIRING_FLASH_0_RELATIVE_ADDRESS_FIELDS
                    };
                    flash_segment_t flashSegmentPairingID1 = {
                                   .bitsPerField = 32,
                                   .numberOfFields = GAZELL_PAIRING_FLASH_NUMBER_OF_FIELDS,
                                   .relativeAddressOfFirstDirtyBit = GAZELL_PAIRING_FLASH_1_RELATIVE_ADDRESS_DIRTY_BITS,
                                   .relativeAddressOfFirstField = GAZELL_PAIRING_FLASH_1_RELATIVE_ADDRESS_FIELDS
                    };
    
                    flashSegmentNumberParingID0 = Flash_RegisterSegment(flashSegmentPairingID0);
                    flashSegmentNumberParingID1 = Flash_RegisterSegment(flashSegmentPairingID1);
    
                    pairID[0] = Flash_ReadData(flashSegmentNumberParingID0);
                    pairID[1] = Flash_ReadData(flashSegmentNumberParingID1);
    
                    nrf_gzll_init(NRF_GZLL_MODE_DEVICE);
                    nrf_gzll_set_max_tx_attempts(50);
                    if((pairID[0] != 0) && pairID[1] != 0)
                    {
                                   nrf_gzll_set_base_address_1(GenerateValidBaseAddressFromChipID(pairID));
                                   isPaired = TRUE;
                    }
    #elif (GAZELL_MODE_HOST == GAZELL_MODE)
                    pairID[0] = NRF_FICR->DEVICEID[0];
                    pairID[1] = NRF_FICR->DEVICEID[1];
                    nrf_gzll_init(NRF_GZLL_MODE_HOST);
                    nrf_gzll_set_base_address_1(GenerateValidBaseAddressFromChipID(pairID));
    #else
    #error GAZELL_MODE is undefined or it has some unknown value.
    #endif
                    nrf_gzll_set_tx_power(NRF_GZLL_TX_POWER_4_DBM);
    #if (250 == GAZELL_BAUDRATE_KBITPS)
                    nrf_gzll_set_datarate(NRF_GZLL_DATARATE_250KBIT);
                    nrf_gzll_set_timeslot_period(2700);
    #elif (1000 == GAZELL_BAUDRATE_KBITPS)
                    nrf_gzll_set_datarate(NRF_GZLL_DATARATE_1MBIT);
                    nrf_gzll_set_timeslot_period(900);
    #elif (2000 == GAZELL_BAUDRATE_KBITPS)
    #else
    #error Wrong baudrate selected. Possible values are 2000, 1000 or 250.
    #endif
             nrf_gzll_set_device_channel_selection_policy(NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_CURRENT);
                    generateAndSetChannelTable();
                    nrf_gzll_set_timeslots_per_channel(5);
                    nrf_gzll_set_timeslots_per_channel_when_device_out_of_sync(1);
                    nrf_gzll_enable();
    }
    
Children
No Data
Related