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