uint16_t dir;
uint8_t Add[5]={0xe7,0xe7,0xe7,0xe7,0xe7};//NRF发送地址复位值
uint8_t Add1[5]={0xaa,0xaa,0xaa,0xaa,0x01};
uint8_t Data[32]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
Sys_Init();
SPI='R';
Nrf24l01_Write(CONFIG,0x0f);
delay_ms(2);
Nrf24l01_WriteCOmmond(FLUSH_RX );
delay_ms(2);
Nrf24l01_Write(RX_PW_P1 ,0x05);
delay_ms(2);
Nrf24l01_Write(CONFIG,0x0e);
SPI='T';
Nrf24l01_WriteCOmmond(FLUSH_TX );
delay_ms(2);
Nrf24l01_WriteBuff(Data,5);//往发送缓冲写5个数据
delay_ms(2);
Nrf24l01_Write(CONFIG,0x0e);
CE_Set ();
delay_ms(1);
CE_Reset ();
delay_ms(5);
Nrf24l01_Read(STATUS ) ;
SPI='R';
delay_ms(5);
Nrf24l01_Read(STATUS ) ;
while(1);
SPI等于R和T是配置的nrf24l01,两个NRF使用的是MCU不同的IO口。
负责接收的NRF在发送NRF发送数据后,读STATUs寄存器还是0x0e,这是怎么回事。发送NRF在发送后读取status寄存器就是发送次数到达上限
更多回帖