我没有使用FIFO功能,就是简单的程序如下:
#include "DSP280x_Device.h" // Headerfile Include File
#include "DSP280x_Examples.h" // Examples Include File
Uint16 Sci_VarRx[10]=[0x11,0xee,0x33,0xaa,0x44,0xbb,0x55,0xcc,0x66,0xdd];
unsigned int i;
void InitSci()
[
SciaRegs.SCICCR.bit.STOPBITS=0;
SciaRegs.SCICCR.bit.PARITYENA=0;
SciaRegs.SCICCR.bit.LOOPBKENA=0;
SciaRegs.SCICCR.bit.ADDRIDLE_MODE=0;
SciaRegs.SCICCR.bit.SCICHAR=7;
SciaRegs.SCICTL1.bit.TXENA=1;
SciaRegs.SCICTL1.bit.RXENA=0;
SciaRegs.SCIHBAUD=0x01;
SciaRegs.SCILBAUD=0x43;
SciaRegs.SCICTL1.bit.SWRESET=1;
]
void InitGpio()
[
EALLOW;
GpioCtrlRegs.GPAPUD.bit.GPIO28= 0;
GpioCtrlRegs.GPAMUX2.bit.GPIO28=1;
EDIS;
]
void main()
[
InitSysCtrl();//关闭看门狗 初始化系统时钟和外设时钟
DINT;
IER = 0x0000;
IFR = 0x0000;
InitPieCtrl();
InitPieVectTable();
InitGpio();
InitSci();
i=0;
for(;;)
[
if(SciaRegs.SCICTL2.bit.TXRDY)
[
SciaRegs.SCITXBUF = Sci_VarRx
;
i++;
]
}
}
//===================================== // No more. //=====================================//
最开始单步运行时SCICTL2为0x00C0,然后可以把数据0x11传到buff,继续单步时SCICTL2为0x0080,然后可以把数据0xee传到buff,然后再一直单步时SCICTL2就一直是0x0000了,而我全部运行后然后又暂停,buff的值会在数组中的数之间变化,但是SCICTL2的值一直是0x0000。请问这是什么原因呢?
我没有使用FIFO功能,就是简单的程序如下:
#include "DSP280x_Device.h" // Headerfile Include File
#include "DSP280x_Examples.h" // Examples Include File
Uint16 Sci_VarRx[10]=[0x11,0xee,0x33,0xaa,0x44,0xbb,0x55,0xcc,0x66,0xdd];
unsigned int i;
void InitSci()
[
SciaRegs.SCICCR.bit.STOPBITS=0;
SciaRegs.SCICCR.bit.PARITYENA=0;
SciaRegs.SCICCR.bit.LOOPBKENA=0;
SciaRegs.SCICCR.bit.ADDRIDLE_MODE=0;
SciaRegs.SCICCR.bit.SCICHAR=7;
SciaRegs.SCICTL1.bit.TXENA=1;
SciaRegs.SCICTL1.bit.RXENA=0;
SciaRegs.SCIHBAUD=0x01;
SciaRegs.SCILBAUD=0x43;
SciaRegs.SCICTL1.bit.SWRESET=1;
]
void InitGpio()
[
EALLOW;
GpioCtrlRegs.GPAPUD.bit.GPIO28= 0;
GpioCtrlRegs.GPAMUX2.bit.GPIO28=1;
EDIS;
]
void main()
[
InitSysCtrl();//关闭看门狗 初始化系统时钟和外设时钟
DINT;
IER = 0x0000;
IFR = 0x0000;
InitPieCtrl();
InitPieVectTable();
InitGpio();
InitSci();
i=0;
for(;;)
[
if(SciaRegs.SCICTL2.bit.TXRDY)
[
SciaRegs.SCITXBUF = Sci_VarRx
;
i++;
]
}
}
//===================================== // No more. //=====================================//
最开始单步运行时SCICTL2为0x00C0,然后可以把数据0x11传到buff,继续单步时SCICTL2为0x0080,然后可以把数据0xee传到buff,然后再一直单步时SCICTL2就一直是0x0000了,而我全部运行后然后又暂停,buff的值会在数组中的数之间变化,但是SCICTL2的值一直是0x0000。请问这是什么原因呢?
举报