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.
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.SCIRXINTA = &sciaRxIsr;//&sciaRxFifoIsr
PieVectTable.SCITXINTA = &sciaTxIsr;
EDIS;
//开中断
DINT;
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 SCIASendData(int a)
{
while (SciaRegs.SCICTL2.bit.TXRDY == 0) {}
SciaRegs.SCITXBUF=a;
}
void SCIASendStr(char * msg)
{
int i;
i = 0;
while(msg[i] != '\0')
{
SCIASendData(msg[i]);
i++;
}
}