Part Number: TMS320F28069
Hi,
I setup a SCI interrupt in my code as below:
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.SCIRXINTA = &sciaRxFifoIsr;
EDIS; // This is needed to disable write to EALLOW protected registers
scia_fifo_init(); // Init SCI-A
void scia_fifo_init()
{
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;
SciaRegs.SCIHBAUD = 0x0000;
SciaRegs.SCILBAUD = 0xC4; //14400
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;
}
this is my ISR:
__interrupt void sciaRxFifoIsr(void)
{
GpioDataRegs.GPBTOGGLE.bit.GPIO39=1;
if(SciaRegs.SCIRXST.bit.RXERROR){
SciaRegs.SCICTL1.bit.SWRESET=0; // Reset active low.
SciaRegs.SCICTL1.bit.SWRESET=1;
}
SciaRegs.SCIFFRX.bit.RXFFOVRCLR=1; // Clear Overflow flag
SciaRegs.SCIFFRX.bit.RXFFINTCLR=1; // Clear Interrupt flag
PieCtrlRegs.PIEACK.all|=0x100; // Issue PIE ack
}
I noticed that when I use my PC keyboard to send a character or a number ( from Terra Term), I have to hit the keyboard selected button twice in order to get an interrupt. I checked that in the debugger and also with the LED. the LED toggles only if I send the character twice.
Is that how this SCI interface work on this chip?