Hi
When i send data package >3 Byte data is change position
I sent 1234567890
but it recceive is 9012345678
or
Sent 12345
Receive 45123
This my code
LOCAL::
while(1)//main program loop
{
data = 0;
if(DataRdy1USART( ))
{
data = getc1USART();
nrf24l01_write_tx_payload(&data, 1, true);
while(Busy1USART( ));
while(!(nrf24l01_irq_pin_active() && nrf24l01_irq_tx_ds_active()));
nrf24l01_irq_clear_all();
}
ToggleLED(); //toggle the on-board LED as visual indication that the loop has completed
}//While(1)…
nrf24l01_initialize(nrf24l01_CONFIG_DEFAULT_VAL | nrf24l01_CONFIG_PWR_UP, //1 byte CRC, powered up
true, //enable CE
nrf24l01_EN_AA_ENAA_NONE, //Disable auto-ack on all pipes
nrf24l01_EN_RXADDR_DEFAULT_VAL, //enable receive on all pipes
nrf24l01_SETUP_AW_DEFAULT_VAL, //5-byte addressing
nrf24l01_SETUP_RETR_DEFAULT_VAL, //not using auto-ack, so use default
nrf24l01_RF_CH_DEFAULT_VAL, //RF channel 3
nrf24l01_RF_SETUP_DEFAULT_VAL, //2 Mbps, 0 dBm
NULL, //nrf24l01_RX_ADDR_P0_DEFAULT_VAL(E7:E7:E7:E7:E7)
NULL, //nrf24l01_RX_ADDR_P1_DEFAULT_VAL(C2:C2:C2:C2:C2)
nrf24l01_RX_ADDR_P2_DEFAULT_VAL, //(C2:C2:C2:C2:[C3])
nrf24l01_RX_ADDR_P3_DEFAULT_VAL, //(C2:C2:C2:C2:[C4])
nrf24l01_RX_ADDR_P4_DEFAULT_VAL, //(C2:C2:C2:C2:[C5])
nrf24l01_RX_ADDR_P5_DEFAULT_VAL, //(C2:C2:C2:C2:[C6])
NULL, //default TX address(E7:E7:E7:E7:E7)
1, //1 byte paylaod width on pipe 0
nrf24l01_RX_PW_P1_DEFAULT_VAL, //0x00
nrf24l01_RX_PW_P2_DEFAULT_VAL, //0x00
nrf24l01_RX_PW_P3_DEFAULT_VAL, //0x00
nrf24l01_RX_PW_P4_DEFAULT_VAL, //0x00
nrf24l01_RX_PW_P5_DEFAULT_VAL); //0x00
REMOTE::
while(TRUE)
{
//wait until a packet has been received
while(!(nrf24l01_irq_pin_active() && nrf24l01_irq_rx_dr_active()));
nrf24l01_read_rx_payload(&data, 1); //read the packet into data
nrf24l01_irq_clear_all(); //clear all interrupts in the 24L01
putc1USART(data);
ToggleLED(); //toggle the on-board LED as visual indication that the loop has completed
} // While True …
nrf24l01_initialize(nrf24l01_CONFIG_DEFAULT_VAL | nrf24l01_CONFIG_PWR_UP | nrf24l01_CONFIG_PRIM_RX, //1 byte CRC, powered up, RX
true, //enable CE
nrf24l01_EN_AA_ENAA_NONE, //disable auto-ack on all pipes
nrf24l01_EN_RXADDR_ERX_ALL, //enable receive on all pipes
nrf24l01_SETUP_AW_DEFAULT_VAL, //5-byte addressing
nrf24l01_SETUP_RETR_DEFAULT_VAL, //not using auto-ack, so use default
nrf24l01_RF_CH_DEFAULT_VAL, //RF channel 3
nrf24l01_RF_SETUP_DEFAULT_VAL, //2 Mbps, 0 dBm
NULL, //nrf24l01_RX_ADDR_P0_DEFAULT_VAL(E7:E7:E7:E7:E7)
NULL, //nrf24l01_RX_ADDR_P1_DEFAULT_VAL(C2:C2:C2:C2:C2)
nrf24l01_RX_ADDR_P2_DEFAULT_VAL, //(C2:C2:C2:C2:[C3])
nrf24l01_RX_ADDR_P3_DEFAULT_VAL, //(C2:C2:C2:C2:[C4])
nrf24l01_RX_ADDR_P4_DEFAULT_VAL, //(C2:C2:C2:C2:[C5])
nrf24l01_RX_ADDR_P5_DEFAULT_VAL, //(C2:C2:C2:C2:[C6])
NULL, //default TX address(E7:E7:E7:E7:E7)
1, //1 byte paylaod width on all 6 pipes
1, //“”
1, //“”
1, //“”
1, //“”
1); //“”