<p>
uint16_t dir;<br />
uint8_t Add[5]={0xe7,0xe7,0xe7,0xe7,0xe7};//NRF发送地址复位值<br />
uint8_t Add1[5]={0xaa,0xaa,0xaa,0xaa,0x01};<br />
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};<br />
Sys_Init();<br />
SPI='R';<br />
Nrf24l01_Write(CONFIG,0x0f);<br />
delay_ms(2);<br />
Nrf24l01_WriteCOmmond(FLUSH_RX );<br />
delay_ms(2);<br />
Nrf24l01_Write(RX_PW_P1 ,0x05);<br />
delay_ms(2);<br />
Nrf24l01_Write(CONFIG,0x0e);<br />
SPI='T';<br />
Nrf24l01_WriteCOmmond(FLUSH_TX );<br />
delay_ms(2);<br />
Nrf24l01_WriteBuff(Data,5);//往发送缓冲写5个数据<br />
delay_ms(2);<br />
Nrf24l01_Write(CONFIG,0x0e);<br />
CE_Set ();<br />
delay_ms(1);<br />
CE_Reset ();<br />
delay_ms(5);<br />
Nrf24l01_Read(STATUS ) ;<br />
SPI='R';<br />
delay_ms(5);<br />
Nrf24l01_Read(STATUS ) ;<br />
while(1);
</p>
<p>
SPI等于R和T是配置的nrf24l01,两个NRF使用的是MCU不同的IO口。
</p>
<p>
负责接收的NRF在发送NRF发送数据后,读STATUs寄存器还是0x0e,这是怎么回事。发送NRF在发送后读取status寄存器就是发送次数到达上限
</p> |