将CC1101的IOCFG2改为0x06,使用中断接收信号,通讯距离比轮询接收少了100多米。请问可能是什么原因,有没有中断接收的例程。
一下是我的中断接收程序

This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好,
首先、我不知道您的设置、或者您说您有一个轮询接收器(您是轮询 GDO 引脚、轮询寄存器吗?)时、您在轮询什么内容?
此外、我不知道 GDO0的配置是什么、或者是否有下降或上升中断。
另一方面、您不应在 ISR 中进行大量处理、也不应实现软件延迟。
您的软件只需执行以下操作:
void main(void)
{
// initialize MCU and peripherals
// Write radio registers (use defaut from SmarrtRF Studio to start with)
// Configure falling ede interrupt on GDOx (IOCFGx = 0x06)
// Set radio in RX
trxSpiCmdStrobe(CC1101_SRX);
// Infinite loop
while(TRUE)
{
// wait for packet received interrupt (falling edge interrupt)
if(packetSemaphore == ISR_ACTION_REQUIRED)
{
// Read number of bytes in RX FIFO
cc1101SpiReadReg(CC1101_RXBYTES,&rxBytes, 1);
// Check that we have bytes in FIFO
if(rxBytes != 0)
{
// Check for RX FIFO overflow (MSB of RXBYTES)
if(rxBytes & 0x80)
{
// Flush RX FIFO
trxSpiCmdStrobe(CC1101_SFRX);
}
else
{
// Read n bytes from RX FIFO
cc1101SpiReadRxFifo(rxBuffer,(rxBytes));
// Check CRC ok (CRC_OK: bit7 in second status byte)
}
}
// Reset packet semaphore
packetSemaphore = ISR_IDLE;
// Set radio back in RX
trxSpiCmdStrobe(CC1101_SRX);
}
}
}
static void rxISR(void)
{
// Set packet semaphore
packetSemaphore = ISR_ACTION_REQUIRED;
// Clear ISR flag
}