Hi every one,
I am working on wireless connectivity project using simpliciTI. I am having the CC2510 mini development board with me. Now i am familiar with the microcontroller which is embedded in it. But i am getting problems in programming thr radio that is present in the chip.
When i am writing code for continuous transmissioin of a character using ISR when RFTXRXIF is enabled it is not working. The below is the code i have written to transmitt the character continuously. The problem with the code is the ISR function is not executing when the RFTXRXIF interrup is asserting.
Suggest the suitable solution to it.
#include<ioCC2510.h>
#include<ioCCxx10_bitdef.h>
void tdelay(unsigned int );
volatile unsigned char ch;
void main(void)
{
CLKCON=0x00;
SLEEP &= ~SLEEP_OSC_PD;
while( !(SLEEP & SLEEP_XOSC_S) );
CLKCON = (CLKCON & ~(CLKCON_CLKSPD | CLKCON_OSC)) | CLKSPD_DIV_1;
while (CLKCON & CLKCON_OSC);
SLEEP |= SLEEP_OSC_PD;
RFTXRXIE=1;
/* RF settings SoC */
FSCTRL1 = 0x0A; // Frequency Synthesizer Control
FSCTRL0 = 0x00; // Frequency Synthesizer Control
FREQ2 = 0x5D; // Frequency Control Word, High Byte
FREQ1 = 0x44; // Frequency Control Word, Middle Byte
FREQ0 = 0xEC; // Frequency Control Word, Low Byte
MDMCFG4 = 0x28; // Modem configuration
MDMCFG3 = 0x83; // Modem Configuration
MDMCFG2 = 0x03; // Modem Configuration
MDMCFG1 = 0x23; // Modem Configuration
MDMCFG0 = 0x3B; // Modem Configuration
CHANNR = 0x00; // Channel Number
DEVIATN = 0x00; // Modem Deviation Setting
FREND1 = 0xB6; // Front End RX Configuration
FREND0 = 0x10; // Front End TX Configuration
MCSM0 = 0x14; // Main Radio Control State Machine Configuration
FOCCFG = 0x1D; // Frequency Offset Compensation Configuration
BSCFG = 0x1C; // Bit Synchronization Configuration
AGCCTRL2 = 0xC7; // AGC Control
AGCCTRL1 = 0x00; // AGC Control
AGCCTRL0 = 0xB2; // AGC Control
FSCAL3 = 0xA9; // Frequency Synthesizer Calibration
FSCAL2 = 0x0A; // Frequency Synthesizer Calibration
FSCAL1 = 0x00; // Frequency Synthesizer Calibration
FSCAL0 = 0x11; // Frequency Synthesizer Calibration
TEST2 = 0x88; // Various Test Settings
TEST1 = 0x31; // Various Test Settings
TEST0 = 0x09; // Various Test Settings
PA_TABLE0 = 0xFE; // PA Power Setting
PKTCTRL1 = 0x04; // Packet Automation Control
PKTCTRL0 = 0x05; // Packet Automation Control
ADDR = 0x00; // Device Address
PKTLEN = 0xFF; // Packet Length
MCSM1 = 0x32;
RFIM=0x80;
RFST=RFST_SCAL;
RFST=RFST_STX;
while(1)
{
//RFTXRXIF=0;
RFD='s';
while(RFTXRXIF==0);
//RFTXRXIF=0;
while ((MARCSTATE & MARCSTATE_MARC_STATE) != MARC_STATE_TX)
{
RFST=RFST_SIDLE;
RFST=RFST_STX;
}
}
}
_Pragma ("vector=RFTXRX_VECTOR") __interrupt void TX_UNFLW_INTR(void);
_Pragma ("vector=RFTXRX_VECTOR") __interrupt void TX_UNFLW_INTR (void)
{
RFTXRXIF=0;
}
Suggest the suitable solution to it.
Regards
N S S Sandeep