微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI无线射频设计 > cc430f5137接收状态频频死机

cc430f5137接收状态频频死机

时间:12-23 整理:3721RD 点击:

问题 描述: 使用cc430f5137一个作为发送端,一个作为接收端。发送端能正常工作,接收端经常死机,一般半小时左右就会死。

                     用的是TI的代码,只要设置ReceiveOn();就会死机,连串口都不通,如果不设置为接收态就没事。 

                   以下为部分代码,请大师解答,谢谢!

void main( void )
{

// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;

Init_IO();
InitButtonLeds();
//WDTCTL = WDT_ARST_250;

SetVCore(0);
delayms(20);

ResetRadioCore();
InitRadio();

ReceiveOn();
receiving = 1;
while (1)

{

}

}
void InitRadio(void)
{
// Set the High-Power Mode Request Enable bit so LPM3 can be entered
// with active radio enabled
PMMCTL0_H = 0xA5;
PMMCTL0_L |= PMMHPMRE_L;
PMMCTL0_H = 0x00;

WriteRfSettings(&rfSettings);

WriteSinglePATable(PATABLE_VAL);
}

void Transmit(unsigned char *buffer, unsigned char length)
{
RF1AIES |= BIT9;
RF1AIFG &= ~BIT9; // Clear pending interrupts
RF1AIE |= BIT9; // Enable TX end-of-packet interrupt

WriteBurstReg(RF_TXFIFOWR, buffer, length);

Strobe( RF_STX ); // Strobe STX
}

void ReceiveOn(void)
{
RF1AIES |= BIT9; // Falling edge of RFIFG9
RF1AIFG &= ~BIT9; // Clear a pending interrupt
RF1AIE |= BIT9; // Enable the interrupt

// Radio is in IDLE following a TX, so strobe SRX to enter Receive Mode
Strobe( RF_SRX );
}

void ReceiveOff(void)
{
RF1AIE &= ~BIT9; // Disable RX interrupts
RF1AIFG &= ~BIT9; // Clear pending IFG

// It is possible that ReceiveOff is called while radio is receiving a packet.
// Therefore, it is necessary to flush the RX FIFO after issuing IDLE strobe
// such that the RXFIFO is empty prior to receiving a packet.
Strobe( RF_SIDLE );
Strobe( RF_SFRX );
}

#pragma vector=CC1101_VECTOR
__interrupt void CC1101_ISR(void)
{
switch(__even_in_range(RF1AIV,32)) // Prioritizing Radio Core Interrupt
{
case 0: break; // No RF core interrupt pending
case 2: break; // RFIFG0
case 4: break; // RFIFG1
case 6: break; // RFIFG2
case 8: break; // RFIFG3
case 10: break; // RFIFG4
case 12: break; // RFIFG5
case 14: break; // RFIFG6
case 16: break; // RFIFG7
case 18: break; // RFIFG8
case 20: // RFIFG9
if(receiving) // RX end of packet
{
// Read the length byte from the FIFO
// RxBufferLength = ReadSingleReg( RXBYTES );
// ReadBurstReg(RF_RXFIFORD, RxBuffer, RxBufferLength);

// Stop here to see contents of RxBuffer
__no_operation();


Flag_rx_over=0x01;
receiving = 0;

}
else if(transmitting) // TX end of packet
{
RF1AIE &= ~BIT9; // Disable TX end-of-packet interrupt
// LEDR_OFF(); // Turn off LED after Transmit
transmitting = 0;

Flag_tx_over=0x01;

}
// else while(1); // trap
break;
case 22: break; // RFIFG10
case 24: break; // RFIFG11
case 26: break; // RFIFG12
case 28: break; // RFIFG13
case 30: break; // RFIFG14
case 32: break; // RFIFG15
}
//__bic_SR_register_on_exit(LPM3_bits);

}

同样的代码在TI开发板上会死机吗?

谢谢,开发板也会死的,用得是利尔达的收发模块,利尔达的代码是依靠看门狗复位处理死机的,不可取。

我在网上查过相关信息,觉得不少人被这种情况坑过,应该会有解决办法吧?

顶顶

你好这个问题是怎么处理的呀 ,我最近才做了一个板子 ,把程序烧写进去,一开始可以通信,过半个小时候之后,就通信不上了,反应到电流上的变化时 ,正常情况下总电流18mA ,过半个小时候之后  电流就下降到2mA,且通信不上

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top