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.

TMS320F28055: SCI-X single character receive

Part Number: TMS320F28055


Hi,

In the SCI-A/SCI-B/SCI-C module, we need to send two character from external source to get the data through interrupt. Is there any settings to receive single character data? my code as below.  

//_______________________________________________________________________________________________________________________
void scia_Interrupt_Config(void)
{
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.SCIRXINTA = &sciaRxFifoIsr;
PieVectTable.SCITXINTA = &sciaTxFifoIsr;
EDIS; // This is needed to disable write to EALLOW protected registers

PieCtrlRegs.PIECTRL.bit.ENPIE = 1; // Enable the PIE block
PieCtrlRegs.PIEIER9.bit.INTx1= 1; // PIE Group 9, INT1
PieCtrlRegs.PIEIER9.bit.INTx2= 1; // PIE Group 9, INT2
IER = 0x100; // Enable CPU INT

EINT;
}
//_______________________________________________________________________________________________________________________
void scia_Port_Config(void)
{
EALLOW;
GpioCtrlRegs.GPAPUD.bit.GPIO28 = 0; // Enable pull-up for GPIO28 (SCIRXDA)
GpioCtrlRegs.GPAPUD.bit.GPIO29 = 0; // Enable pull-up for GPIO29 (SCITXDA)
GpioCtrlRegs.GPAQSEL2.bit.GPIO28 = 3; // Asynch input GPIO28 (SCIRXDA)
GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 1; // Configure GPIO28 for SCIRXDA
GpioCtrlRegs.GPAMUX2.bit.GPIO29 = 1; // Configure GPIO29 for SCITXDA
EDIS;


EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO9 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO9 = 1;
EDIS;
}
//_______________________________________________________________________________________________________________________
void scia_Module_config(void)
{
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.bit.TXINTENA = 1;
SciaRegs.SCICTL2.bit.RXBKINTENA = 1;
Set_Baud_Rate(9600);
SciaRegs.SCICCR.bit.LOOPBKENA =0; // 1; // Enable loop back
SciaRegs.SCIFFTX.all = 0xC022;
SciaRegs.SCIFFRX.all = 0x0022;
SciaRegs.SCIFFCT.all = 0x00;

SciaRegs.SCICTL1.all = 0x0023; // Relinquish SCI from Reset
// SciaRegs.SCIFFTX.bit.TXFIFOXRESET = 1;
SciaRegs.SCIFFRX.bit.RXFIFORESET = 1;
}
//_______________________________________________________________________________________________________________________
interrupt void sciaTxFifoIsr(void)
{
if(SerialA.scia_bfr_ptr_tx<SerialA.scia_tx_count+1)
{
SciaRegs.SCITXBUF=SerialA.scia_bfr_tx[SerialA.scia_bfr_ptr_tx];
SerialA.scia_bfr_ptr_tx++;
SciaRegs.SCITXBUF=SerialA.scia_bfr_tx[SerialA.scia_bfr_ptr_tx];
SerialA.scia_bfr_ptr_tx++;
}
else
{
SciaRegs.SCIFFTX.bit.TXFIFOXRESET =0;
SCIA_set_RX();
}
SciaRegs.SCIFFTX.bit.TXFFINTCLR = 1; // Clear SCI Interrupt flag
PieCtrlRegs.PIEACK.all |= 0x100; // Issue PIE ACK
}
//_______________________________________________________________________________________________________________________
interrupt void sciaRxFifoIsr(void)
{
SerialA.scia_bfr_rx[SerialA.scia_bfr_ptr_rx] = SciaRegs.SCIRXBUF.all; // Read data
if(SerialA.scia_bfr_ptr_rx<scia_bfr_count) SerialA.scia_bfr_ptr_rx++;
SerialA.scia_bfr_rx[SerialA.scia_bfr_ptr_rx] = SciaRegs.SCIRXBUF.all; // Read data
if(SerialA.scia_bfr_ptr_rx<scia_bfr_count) SerialA.scia_bfr_ptr_rx++;

SciaRegs.SCIFFRX.bit.RXFFOVRCLR = 1; // Clear Overflow flag
SciaRegs.SCIFFRX.bit.RXFFINTCLR = 1; // Clear Interrupt flag

PieCtrlRegs.PIEACK.all |= 0x100; // Issue PIE ack
}

//_______________________________________________________________________________________________________________________

Best Regards-

Sudip