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.

TMS320F280025C: SCI Interrupts...transmit interrupts

Part Number: TMS320F280025C

It seems that the SCI on the 280025 is slightly different than the SCI of say, 2407, 28069, 28388.

I have a piece of code that I have run for my transmit interrupt routine for that last 30 years. Have used it on Z80's, 8031's 6502's and the other TI DSP noted above. 

Pretty basic stuff. Set up a non FIFO Serial port. Have the message to transmit in a buffer. Send a charachter outside the interrupt to "prime the pump". As soon as the TXBUF is empty, interrupt happens, load the next character, acknowledge the interrupt and leave. 

This will run until the EOF character (0xff in my case) is hit. 

Not so with the 280025. I load the first character, interrupt happens two times and then never interrupts again. 

__interrupt void SCITXINTA_ISR(void)

{
asm(" CLRC INTM"); /* enable global interrupts */

if (CommunicationsFlags.xmiting == 1)
{
if((TXBUF[IntTXPTR] != 0xFF) && (IntTXPTR <=XMITBufLen )) //something to xmit/
{
//SCI_writeCharBlockingNonFIFO(SCIA_BASE,TXBUF[IntTXPTR]);
 SCI_writeCharNonBlocking(SCIA_BASE,TXBUF[IntTXPTR]);

IntTXPTR++;

}
else //xmit is complete
{

for (xser=0;xser < XMITBufLen;xser++)//fill buffer with 0ff's to "clear"
{
TXBUF[xser] = 0xFF;
XMITString[xser] = 0;
}
CommunicationsFlags.xmiting = 0;

GPIO_writePin(DEVICE_GPIO_PIN_485_ENA, 0);//turn off 485 transmitter
SCI_writeCharNonBlocking(SCIA_BASE,255U);//transmit a line turn around character.

} //end else
}//end if xmiting
else//this is here because the xmit register is ready for another character
//but the last character is
{
GPIO_writePin(DEVICE_GPIO_PIN_485_ENA, 0);

// GpioDataRegs.GPBDAT.bit.GPIO50 = 0;// turn off transmitter &= ~0x0004;//was 0x0004
}

Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
return;
}//end if ti

commenst? brilliant ideas?

  • Okay, here it is, the 280025 SCI IS slightly different than the rest. I may have failed to mention that this is a 485 serial communicaion, so the RX gets what ever the TX is dishing out. Previous incarnations of the SCI handled the acknowledgement of the interrupts a bit different so ack for RX did not mess up ack for TX. Not so here. 

    Solution...disable RX interrupts while transmitting. re-enable when done. Everything all good now.