I am developing an application with a microcontroller CC430F5135. She is functional but there is still a bug to solve.
The MCU initializes the radio (RF1A) with no problems started operation OK. I usa a CCSv4. por programing.
Upon receiving a data packet it generates an interrupt RFIFG9. This is usually served!
In the next packet received by CC430 interruption does not happen because there is still a pending interrupt RFIF10
Radio to come back it to receive packages is necessary to effect flush of the reception buffer, but this is an alternative that did not decide the case electively. In I finish in case that reset of radio Core is necessary. The application eats alimpeza of the reception buffer wheel some days without problems. but, suddenly, constraint everything is and necessary to resetar the MCU. Sege below pieces of the code source to help in the solution of the problem.
/******************************************************************************
* @Função: Interrupção
* @Finalidade: interrupt routine.
* @parametros:
* Nenhum.
* @retorno:
* Nenhum.
*******************************************************************************/
#pragma
void CC1101_ISR(void)
{ __no_operation();
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:
ir=0;
// RFIFG9
if(receiving ) // RX end of packet
{
// Read the length byte from the FIFO
RxBufferLength = ReadSingleReg( RXBYTES );
ReadBurstReg(RF_RXFIFORD, RxBuffer, RxBufferLength);
__no_operation();
// Stop here to see contents of RxBuffer
RSSIVal=RxBuffer[RxBufferLength-2];
if (RSSIVal <= 128)
RSSIVal = (RSSIVal>>1) - 74;
else
RSSIVal = ((RSSIVal-256)>>1) - 74;
if((RxBuffer[RxBufferLength-1] & CRC_OK))
{ RF_PacoteRecebido=1; ReceiveOff(); ReceiveOn(); }
else
{ ReceiveOff(); ReceiveOn(); __bic_SR_register_on_exit(GIE); } }
else if(transmitting) // TX end of packet
{
RF1AIE &= ~BIT9;
// Disable TX end-of-packet interrupt
transmitting = 0;
TXActive=0;
ReceiveOff();
ReceiveOn();
__bic_SR_register_on_exit(GIE);
// Exit active
}
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(GIE);
}
vector=CC1101_VECTOR__interrupt
//in to main function.
if((RF_PacoteRecebido==1))
{
RF_PacoteRecebido=0/
// It treats information. received from the RFA1
ReceiveOn();
receiving = 1;
__bis_SR_register( GIE);
}