dsp与pc机的sci通信,一台电脑与dsp连接,另一台与dsp串口连接,串口调试助手怎么会无限接收到这几个数据
#include"DSP2833x_Device.h"//DSP2833xHeaderfileIncludeFile#include"DSP2833x_Examples....
#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会无限的发送数据呢
在另一台电脑的串口调试助手会接受到正确的数据,但是会一直接收这几个数据,怎么是无限循环呢,程序的问题出在哪了 求解释啊!!!! 展开
#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会无限的发送数据呢
在另一台电脑的串口调试助手会接受到正确的数据,但是会一直接收这几个数据,怎么是无限循环呢,程序的问题出在哪了 求解释啊!!!! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询