#include "DSP2833x_Device.h" // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h" // DSP2833x Examples Include File
#define SCI 1
#define UART_INT 0
interrupt void scibTxFifoIsr(void);
void scib_fifo_init();
void error(void);
Uint16 sdataB[6]={0x03,0x06,0x00,0x00,0x04,0x7F};
void main(void)
{
Uint16 i;
InitSysCtrl();
InitGpio();
InitSciGpio();
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
EALLOW;
PieVectTable.SCITXINTB = &scibTxFifoIsr;
EDIS;
scib_fifo_init();
PieCtrlRegs.PIECTRL.bit.ENPIE = 1;
PieCtrlRegs.PIEIER9.bit.INTx3=1;
PieCtrlRegs.PIEIER9.bit.INTx4=1;
IFR = 0x0000;
IER = 0x100;
EINT;
for(;;);
}
interrupt void scibTxFifoIsr(void)
{
Uint16 i;
for(i=0;i<6;i++)
{
ScibRegs.SCITXBUF=sdataB[i];
}
ScibRegs.SCIFFTX.bit.TXFFINTCLR=1; // Clear Interrupt flag
PieCtrlRegs.PIEACK.all|=0x100;
}
void scib_fifo_init()
{
ScibRegs.SCICCR.all =0x0007;
ScibRegs.SCICTL1.all =0x0003;
ScibRegs.SCICTL2.bit.TXINTENA =1;
ScibRegs.SCIHBAUD =0x001e;
ScibRegs.SCICCR.bit.LOOPBKENA =0;
ScibRegs.SCIFFTX.all=0xC020;
ScibRegs.SCIFFCT.all=0x00;
ScibRegs.SCICTL1.all =0x0023;
ScibRegs.SCIFFTX.bit.TXFIFOXRESET=1;
ScibRegs.SCIFFRX.bit.RXFIFORESET=1;
}
void error(void)
{
asm(" ESTOP0"); // Test failed!! Stop!
for (;;);
}
//===========================================================================
// No more.
//===========================================================================
这是我自己改的,应该有很多错误,各位大神别笑话我,我是新手,帮我看下吧,我用dsp向电脑的串口助手发送数据,串口可以收到正确的数据,但是为什么会无限的收到这几个数,dsp无限发送,更笨停不下来,谁能告诉我,这是哪里的问题吗 急求!!!! |