#include "DSP28_Device.h"
#define UART_INT 1
unsigned int uart_sendtype ;
unsigned int Sci_VarRx[100];
unsigned int i,j;
unsigned int Send_Flag;
void main(void)
{
/*初始化系统*/
InitSysCtrl();
/*关中断*/
DINT;
IER = 0x0000;
IFR = 0x0000;
/*初始化PIE中断*/
InitPieCtrl();
/*初始化PIE中断矢量表*/
InitPieVectTable();
/*初始化SCIA寄存器*/
InitSci();
for(i = 0; i < 100; i++)
{
Sci_VarRx = 0;
}
i = 0;
j = 0;
Send_Flag = 0;
#if UART_INT
/*设置中断服务程序入口地址*/
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.TXAINT = &SCITXINTA_ISR;
PieVectTable.RXAINT = &SCIRXINTA_ISR;
EDIS; // This is needed to disable write to EALLOW protected registers
/*开中断*/
IER |= M_INT9;
#endif
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
Sci_VarRx[0]=48;
Sci_VarRx[1]=49;
Sci_VarRx[2]=50;
SciaRegs.SCITXBUF = Sci_VarRx[0];
SciaRegs.SCITXBUF = Sci_VarRx[1];
SciaRegs.SCITXBUF = Sci_VarRx[2];
for(;;)
{}
}
上面的程序,是根据TI的SCI例程改的的,手动输入数据 Sci_VarRx[0]=48,Sci_VarRx[0]=49,Sci_VarRx[0]=50,;
,然后依次送入发送缓冲器再发送至PC的串口助手。可为什么发送三个,只接收到第一个和第三个呢,只能接受到两个数据,为什么啊????
|