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.

rx interrupt in loop back



can any one help.............................

i am working with picolo f28069 comntrol stick .

and  i am trying to generate Rx interrupt  in SCI loop back ,but i am not getting any interrupt

is it possible to generate such interrupt in loop back if possible what procedure we have to follow

and i am attaching my  main source code

 

 

#include

"PeripheralHeaderIncludes.h"

#include

"DSP28x_Project.h"

// Device Headerfile and Examples Include File

void PieCntlInit(void);

void PieVectTableInit(void);

void DeviceInit(void);

void InitFlash(void);

void MemCopy(Uint16 *SourceAddr, Uint16* SourceEndAddr, Uint16* DestAddr);

 

// Prototype statements for functions found within this file.

void scia_loopback_init(void);

void scia_fifo_init(void);

void scia_xmit(inta);

void PieVectTableInit(void);

interrupt void scia_rx_isr(void);

//interrupt void scia_tx_isr(void);

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

// VARIABLE DECLARATIONS - GENERAL

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

// Used for running BackGround in flash, and ISR in RAM

extern Uint16 RamfuncsLoadStart, RamfuncsLoadEnd, RamfuncsRunStart;

 

 

// Global counts used in this example

Uint16 LoopCount;

Uint16 data;

void main(void)

{

Uint16 SendChar;

// Uint16 ReceivedChar;

// Step 1. Initialize System Control registers, PLL, WatchDog, Clocks to default state:

// This function is found in the F2806x_SysCtrl.c file.

//InitSysCtrl();

DeviceInit();

// Device Life support & GPIO mux settings

#ifdef

FLASH

// Copy time critical code and Flash setup code to RAM

// The RamfuncsLoadStart, RamfuncsLoadEnd, and RamfuncsRunStart

// symbols are created by the linker. Refer to the linker files.

MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);

// Call Flash Initialization to setup flash waitstates

// This function must reside in RAM

InitFlash();

// Call the flash wrapper init function

#endif

//(FLASH)

PieCntlInit();

PieVectTableInit();

PieCtrlRegs.PIEIER9.all = 0x0001;

// Enable all SCIA RXINT interrupt

IER |= M_INT9;

// enable PIEIER9, and INT9

EINT;

ERTM;

EALLOW;

PieVectTable.SCIRXINTA = &scia_rx_isr;

EDIS;

scia_fifo_init();

// Initialize the SCI FIFO

scia_loopback_init();

// Initalize SCI for digital loop back

// Note: Autobaud lock is not required for this example

// Send a character starting with 0

SendChar = 0xAAAA;

// Step 6. Send Characters forever starting with 0x00 and going through

// 0xFF. After sending each, check the recieve buffer for the correct value

for(;;)

{

scia_xmit(SendChar);

while(SciaRegs.SCIFFRX.bit.RXFFST !=1) { } // wait for RRDY/RXFFST =1 for 1 data available in FIFO

SendChar = ~(SendChar) ;

}

}

 

// Step 7. Insert all local Interrupt Service Routines (ISRs) and functions here:

 

// Test 1,SCIA DLB, 8-bit word, baud rate 0x000F, default, 1 STOP bit, no parity

void scia_loopback_init()

{

// Note: Clocks were turned on to the SCIA peripheral

// in the InitSysCtrl() function

SciaRegs.SCICCR.all =0x0007;

// 1 stop bit, No loopback

// No parity,8 char bits,

// async mode, idle-line protocol

SciaRegs.SCICTL1.all =0x0003;

// enable TX, RX, internal SCICLK,

// Disable RX ERR, SLEEP, TXWAKE

SciaRegs.SCICTL2.all =0x0003;

SciaRegs.SCICTL2.bit.TXINTENA =1;

SciaRegs.SCICTL2.bit.RXBKINTENA =1;

SciaRegs.SCIHBAUD =0x0000;

SciaRegs.SCILBAUD =0x00C2;

// 9600 baud rate

SciaRegs.SCICCR.bit.LOOPBKENA =1;

// Enable loop back

SciaRegs.SCICTL1.all =0x0023;

// Relinquish SCI from Reset

}

// Transmit a character from the SCI'

void scia_xmit(inta)

{

SciaRegs.SCITXBUF=a;

}

// Initalize the SCI FIFO

void scia_fifo_init()

{

SciaRegs.SCIFFTX.all=0xE040;

SciaRegs.SCIFFRX.all=0x2044;

SciaRegs.SCIFFCT.all=0x0;

}

interrupt void scia_rx_isr(void)

{

data = SciaRegs.SCIRXBUF.all;

PieCtrlRegs.PIEACK.all = PIEACK_GROUP9;

SciaRegs.SCIFFRX.bit.RXFFINTCLR = 1;

// clear Receive interrupt flag

}