开启ack应答的时候发送端的状态值就是46并且成功进入中断,接收方也可以接收数据, 后将ack应答关闭,就算把接收端断电,发送端仍然是46.....接收端都关了怎么可能还有数据进来,应该是2e才对,求大神指教
附上发送端代码:
void TX_Mode(void)
{
NRF24L01_CE=0;
NRF24L01_Write_Buf(WRITE_REG+TX_ADDR,(u8*)TX_ADDRESS,TX_ADR_WIDTH);
NRF24L01_Write_Buf(WRITE_REG+RX_ADDR_P0,(u8*)RX_ADDRESS,RX_ADR_WIDTH);
NRF24L01_Write_Reg(WRITE_REG+EN_AA,0x00); //disable ack
NRF24L01_Write_Reg(WRITE_REG+EN_RXADDR,0x00); //disable 接收通道0
NRF24L01_Write_Reg(WRITE_REG+SETUP_RETR,0x00);//disable 自动重发
NRF24L01_Write_Reg(WRITE_REG+RF_CH,40);
NRF24L01_Write_Reg(WRITE_REG+RF_SETUP,0x07);
NRF24L01_Write_Reg(WRITE_REG+CONFIG,0x0e); //发送模式
NRF24L01_CE=1;//CE值高
}
发送端中断代码:
sta=NRF24L01_Read_Reg(STATUS);
printf("nSTATUS is:n");
printf("%d%",sta);
NRF24L01_Write_Reg(WRITE_REG+STATUS,sta); //clear STATUS
EXti->R=1<<5; //clear line5
更多回帖