Hi.
First of all, if you want to send the first 10 bytes in your array, your code starts on element 1 instead of element 0 of array.
Use Transmition complete like event generator of interrupt doesn't take advantage of SCI module, because we could use the TDRE flag in order to queue new data on SCI module.
So you could use two posibles flags as interruption generators
1.Transmission Complete flag
2. Transmit Data register empty flag
Example to first option:
SCIC2_TCIE = 1; //Call this to start transmission
__interrupt void isrVscitx(void)
{
if(SCIS1_TC)
{
SCID = sendBuffer[txCount];
if(++txCount>=10)
{
SCIC2_TCIE = 0; //Disable interrupt
txCount=0;
//txON=0; //TX hardware enable pin low
}
}
}
Example to second option:
SCIC2_TIE = 1; //Call this to start transmission
__interrupt void isrVscitx(void)
{
if(SCIS1_TDRE)
{
SCID = sendBuffer[txCount];
if(++txCount>=10)
{
SCIC2_TIE = 0; //Disable interrupt
txCount=0;
txON=0; //TX hardware enable pin low
}
}
}
The above examples assumes that you starts correctly the SCI module.
Greetings @420