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

hello We have a project request nrf51822 radio transmitter -> nrf52832 radio receiver

Hello


We have a project request nrf51822 radio transmitter -> nrf52832 radio receiver


nRF5_SDK_11.0.0_89a8197\examples\peripheral\radio\
transmitter\pca10028\arm5_no_packs\transmitter_pca10028.uvprojx

// Radio config
NRF_RADIO->TXPOWER = (RADIO_TXPOWER_TXPOWER_0dBm << RADIO_TXPOWER_TXPOWER_Pos);
NRF_RADIO->FREQUENCY = 7UL; // Frequency bin 7, 2407MHz
NRF_RADIO->MODE = (RADIO_MODE_MODE_Nrf_2Mbit << RADIO_MODE_MODE_Pos);

nRF5_SDK_15.3.0_59ac345\examples\peripheral\radio\receiver\pca10040\blank\arm5_no_packs\receiver_pca10040.uvprojx


// Radio config
NRF_RADIO->TXPOWER = (RADIO_TXPOWER_TXPOWER_0dBm << RADIO_TXPOWER_TXPOWER_Pos);
NRF_RADIO->FREQUENCY = 7UL; // Frequency bin 7, 2407MHz
NRF_RADIO->MODE = (RADIO_MODE_MODE_Nrf_2Mbit << RADIO_MODE_MODE_Pos);


Can not communicate with each other
Is it because the device does not support it or is it
my circuit board/software problem?


We mainly want to ask whether communication is possible or not under normal circumstances?

I'm sorry because our project is very confidential
As a last resort
That’s why I'll add trouble directly to you

Parents
  • Hi,

     

    Can not communicate with each other
    Is it because the device does not support it or is it
    my circuit board/software problem?

    nRF51 is on-air compatible with nRF52-series devices.

     

    Have you started the HFCLK on both ends?

    Have you tried running the radio example on both devices from the same SDK to see how that behaves?

     

    Kind regards,

    Håkon

     

  • Thank you. Wait for me to try more and find out the reasons! Check it out! As long as the equipment designed by your company's chip supports it, it's OK!

  • Hello! I'm sorry!
    I use nrf51822 transmitter -> nrf52832 receiver but still can’t communicate

    Please help me to suggest how to modify it?

    I have confirmed that there is no problem with the clock several times

    nrf51822 16M
    nrf52832 32M

    nRF5_SDK_11.0.0_89a8197\examples\peripheral\radio\transmitter\pca10028\arm5_no_packs\transmitter_pca10028.uvprojx


    nRF5_SDK_11.0.0_89a8197\examples\peripheral\radio\receiver\pca10040\arm5_no_packs\receiver_pca10040.uvprojx


    /**@brief Function for initialization oscillators.
    */
    void clock_initialization()
    {
    /* 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.
    }

    /* Start low frequency crystal oscillator for app_timer(used by bsp)*/
    NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
    NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_LFCLKSTART = 1;

    while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0)
    {
    // Do nothing.
    }
    }
    void radio_configure()
    {
    // Radio config
    NRF_RADIO->TXPOWER = (RADIO_TXPOWER_TXPOWER_Pos4dBm << RADIO_TXPOWER_TXPOWER_Pos);
    NRF_RADIO->FREQUENCY = 7UL; // Frequency bin 7, 2407MHz
    NRF_RADIO->MODE = (RADIO_MODE_MODE_Nrf_2Mbit << RADIO_MODE_MODE_Pos);

    // Radio address config
    NRF_RADIO->PREFIX0 =
    ((uint32_t)swap_bits(0xC3) << 24) // Prefix byte of address 3 converted to nRF24L series format
    | ((uint32_t)swap_bits(0xC2) << 16) // Prefix byte of address 2 converted to nRF24L series format
    | ((uint32_t)swap_bits(0xC1) << 8) // Prefix byte of address 1 converted to nRF24L series format
    | ((uint32_t)swap_bits(0xC0) << 0); // Prefix byte of address 0 converted to nRF24L series format

    NRF_RADIO->PREFIX1 =
    ((uint32_t)swap_bits(0xC7) << 24) // Prefix byte of address 7 converted to nRF24L series format
    | ((uint32_t)swap_bits(0xC6) << 16) // Prefix byte of address 6 converted to nRF24L series format
    | ((uint32_t)swap_bits(0xC4) << 0); // Prefix byte of address 4 converted to nRF24L series format

    NRF_RADIO->BASE0 = bytewise_bitswap(0x01234567UL); // Base address for prefix 0 converted to nRF24L series format
    NRF_RADIO->BASE1 = bytewise_bitswap(0x89ABCDEFUL); // Base address for prefix 1-7 converted to nRF24L series format

    NRF_RADIO->TXADDRESS = 0x00UL; // Set device address 0 to use when transmitting
    NRF_RADIO->RXADDRESSES = 0x01UL; // Enable device address 0 to use to select which addresses to receive

    // Packet configuration
    NRF_RADIO->PCNF0 = (PACKET_S1_FIELD_SIZE << RADIO_PCNF0_S1LEN_Pos) |
    (PACKET_S0_FIELD_SIZE << RADIO_PCNF0_S0LEN_Pos) |
    (PACKET_LENGTH_FIELD_SIZE << RADIO_PCNF0_LFLEN_Pos); //lint !e845 "The right argument to operator '|' is certain to be 0"

    // Packet configuration
    NRF_RADIO->PCNF1 = (RADIO_PCNF1_WHITEEN_Disabled << RADIO_PCNF1_WHITEEN_Pos) |
    (RADIO_PCNF1_ENDIAN_Big << RADIO_PCNF1_ENDIAN_Pos) |
    (PACKET_BASE_ADDRESS_LENGTH << RADIO_PCNF1_BALEN_Pos) |
    (PACKET_STATIC_LENGTH << RADIO_PCNF1_STATLEN_Pos) |
    (PACKET_PAYLOAD_MAXSIZE << RADIO_PCNF1_MAXLEN_Pos); //lint !e845 "The right argument to operator '|' is certain to be 0"

    // CRC Config
    NRF_RADIO->CRCCNF = (RADIO_CRCCNF_LEN_Two << RADIO_CRCCNF_LEN_Pos); // Number of checksum bits
    if ((NRF_RADIO->CRCCNF & RADIO_CRCCNF_LEN_Msk) == (RADIO_CRCCNF_LEN_Two << RADIO_CRCCNF_LEN_Pos))
    {
    NRF_RADIO->CRCINIT = 0xFFFFUL; // Initial value
    NRF_RADIO->CRCPOLY = 0x11021UL; // CRC poly: x^16+x^12^x^5+1
    }
    else if ((NRF_RADIO->CRCCNF & RADIO_CRCCNF_LEN_Msk) == (RADIO_CRCCNF_LEN_One << RADIO_CRCCNF_LEN_Pos))
    {
    NRF_RADIO->CRCINIT = 0xFFUL; // Initial value
    NRF_RADIO->CRCPOLY = 0x107UL; // CRC poly: x^8+x^2^x^1+1
    }
    }

Reply
  • Hello! I'm sorry!
    I use nrf51822 transmitter -> nrf52832 receiver but still can’t communicate

    Please help me to suggest how to modify it?

    I have confirmed that there is no problem with the clock several times

    nrf51822 16M
    nrf52832 32M

    nRF5_SDK_11.0.0_89a8197\examples\peripheral\radio\transmitter\pca10028\arm5_no_packs\transmitter_pca10028.uvprojx


    nRF5_SDK_11.0.0_89a8197\examples\peripheral\radio\receiver\pca10040\arm5_no_packs\receiver_pca10040.uvprojx


    /**@brief Function for initialization oscillators.
    */
    void clock_initialization()
    {
    /* 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.
    }

    /* Start low frequency crystal oscillator for app_timer(used by bsp)*/
    NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
    NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_LFCLKSTART = 1;

    while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0)
    {
    // Do nothing.
    }
    }
    void radio_configure()
    {
    // Radio config
    NRF_RADIO->TXPOWER = (RADIO_TXPOWER_TXPOWER_Pos4dBm << RADIO_TXPOWER_TXPOWER_Pos);
    NRF_RADIO->FREQUENCY = 7UL; // Frequency bin 7, 2407MHz
    NRF_RADIO->MODE = (RADIO_MODE_MODE_Nrf_2Mbit << RADIO_MODE_MODE_Pos);

    // Radio address config
    NRF_RADIO->PREFIX0 =
    ((uint32_t)swap_bits(0xC3) << 24) // Prefix byte of address 3 converted to nRF24L series format
    | ((uint32_t)swap_bits(0xC2) << 16) // Prefix byte of address 2 converted to nRF24L series format
    | ((uint32_t)swap_bits(0xC1) << 8) // Prefix byte of address 1 converted to nRF24L series format
    | ((uint32_t)swap_bits(0xC0) << 0); // Prefix byte of address 0 converted to nRF24L series format

    NRF_RADIO->PREFIX1 =
    ((uint32_t)swap_bits(0xC7) << 24) // Prefix byte of address 7 converted to nRF24L series format
    | ((uint32_t)swap_bits(0xC6) << 16) // Prefix byte of address 6 converted to nRF24L series format
    | ((uint32_t)swap_bits(0xC4) << 0); // Prefix byte of address 4 converted to nRF24L series format

    NRF_RADIO->BASE0 = bytewise_bitswap(0x01234567UL); // Base address for prefix 0 converted to nRF24L series format
    NRF_RADIO->BASE1 = bytewise_bitswap(0x89ABCDEFUL); // Base address for prefix 1-7 converted to nRF24L series format

    NRF_RADIO->TXADDRESS = 0x00UL; // Set device address 0 to use when transmitting
    NRF_RADIO->RXADDRESSES = 0x01UL; // Enable device address 0 to use to select which addresses to receive

    // Packet configuration
    NRF_RADIO->PCNF0 = (PACKET_S1_FIELD_SIZE << RADIO_PCNF0_S1LEN_Pos) |
    (PACKET_S0_FIELD_SIZE << RADIO_PCNF0_S0LEN_Pos) |
    (PACKET_LENGTH_FIELD_SIZE << RADIO_PCNF0_LFLEN_Pos); //lint !e845 "The right argument to operator '|' is certain to be 0"

    // Packet configuration
    NRF_RADIO->PCNF1 = (RADIO_PCNF1_WHITEEN_Disabled << RADIO_PCNF1_WHITEEN_Pos) |
    (RADIO_PCNF1_ENDIAN_Big << RADIO_PCNF1_ENDIAN_Pos) |
    (PACKET_BASE_ADDRESS_LENGTH << RADIO_PCNF1_BALEN_Pos) |
    (PACKET_STATIC_LENGTH << RADIO_PCNF1_STATLEN_Pos) |
    (PACKET_PAYLOAD_MAXSIZE << RADIO_PCNF1_MAXLEN_Pos); //lint !e845 "The right argument to operator '|' is certain to be 0"

    // CRC Config
    NRF_RADIO->CRCCNF = (RADIO_CRCCNF_LEN_Two << RADIO_CRCCNF_LEN_Pos); // Number of checksum bits
    if ((NRF_RADIO->CRCCNF & RADIO_CRCCNF_LEN_Msk) == (RADIO_CRCCNF_LEN_Two << RADIO_CRCCNF_LEN_Pos))
    {
    NRF_RADIO->CRCINIT = 0xFFFFUL; // Initial value
    NRF_RADIO->CRCPOLY = 0x11021UL; // CRC poly: x^16+x^12^x^5+1
    }
    else if ((NRF_RADIO->CRCCNF & RADIO_CRCCNF_LEN_Msk) == (RADIO_CRCCNF_LEN_One << RADIO_CRCCNF_LEN_Pos))
    {
    NRF_RADIO->CRCINIT = 0xFFUL; // Initial value
    NRF_RADIO->CRCPOLY = 0x107UL; // CRC poly: x^8+x^2^x^1+1
    }
    }

Children
  • Hello
    Trouble you again
    I can receive the data in the test now!
    But only the first few bytes can be received!

    #define PACKET_BASE_ADDRESS_LENGTH (4UL) //!< Packet base address length field size in bytes
    #define PACKET_STATIC_LENGTH (10UL) //!< Packet static length in bytes
    //#define PACKET_STATIC_LENGTH (200UL) // TEST Can only receive 50 bytes
    #define PACKET_PAYLOAD_MAXSIZE (PACKET_STATIC_LENGTH) //!< Packet payload maximum size in bytes


    //====================transmitter=======================//
    uint32_t packet[Count]={0};

    use nrf51822 transmitter

    {
    uint32_t Count=0;
    for(Count=0;Count < 10 ; Count++)
    {
    packet[Count] = Count+1;
    }

    }
    packet
    [ 0 ] | 1
    [ 1 ] | 2
    [ 2 ] | 3
    [ 3 ] | 4
    [ 4 ] | 5
    [ 5 ] | 6
    [ 6 ] | 7
    [ 7 ] | 8
    [ 8 ] | 9
    [ 9 ] | 10

    //====================receiver=======================//
    uint32_t packet[Count]={0};
    but
    nrf52832 receiver
    {
    packet
    [ 0 ]   1
    [ 1 ]   2
    [ 2 ]   3
    [ 3 ]   0
    [ 4 ]   0
    [ 5 ]   0
    [ 6 ]   0
    [ 7 ]   0
    [ 8 ]   0
    [ 9 ]   0

    }

Related