求救 ~~ dsk28335-i 的带网口板子 调试不出来
时间:10-02
整理:3721RD
点击:
28335+epm3128+rtl8019as 例程地网口程序只能发送一次数据
代码如下 附件 请指教
另外 关于中断 复用一个 组时会发生冲突吗 原先三个可以用 现在 加了一个 就用不了了
如下代码:
void Initisr()
{
//EnableInterrupts();
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.TINT0 = &ISRTimer0;
PieVectTable.XINT1 = &xint1_isr;
PieVectTable.XINT2 = &xint2_isr;
PieVectTable.ADCINT=&ADC_isr;
// PieVectTable.SCIRXINTC= &SCICR_isr;//SCI-C接收中断重定位
// PieVectTable.SCIRXINTB= &SCIBR_isr;//SCI-B接收中断重定位
EDIS; // This is needed to disable write to EALLOW protected registers
InitCpuTimers(); // For this example, only initialize the Cpu Timers
ConfigCpuTimer(&CpuTimer0, 150, 10000000); //定时器时间 修改 多加了1个0
// IER |= M_INT8; // Enable CPU int8
IER |= M_INT1; // Enable CPU int1 link to TIMER0/ADC
// IER |= M_INT9; // Enable CPU int9 link to scic/scib
PieCtrlRegs.PIECTRL.bit.ENPIE = 1; // Enable the PIE block
// PieCtrlRegs.PIEIER8.bit.INTx5 = 1; // Enable PIE Gropu 8 SCIRXINTC SCI-C
// PieCtrlRegs.PIEIER9.bit.INTx3 = 1; // Enable PIE Gropu 9 SCIRXINTB SCI-B
PieCtrlRegs.PIEIER1.bit.INTx1 = 1; // Enable PIE Gropu 1 XINT1
PieCtrlRegs.PIEIER1.bit.INTx2 = 1; //Enable PIE Gropu 2 XINT2
PieCtrlRegs.PIEIER1.bit.INTx4 = 1; //ADC中断
PieCtrlRegs.PIEIER1.bit.INTx3 = 1; //定时器0
/*设置XINT1*/
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO15 = 0; // GPIO
GpioCtrlRegs.GPADIR.bit.GPIO15 = 0; // input
GpioCtrlRegs.GPAQSEL1.bit.GPIO15 = 2; // XINT1 Qual using 6 samples
GpioCtrlRegs.GPACTRL.bit.QUALPRD1 = 0x80; // Each sampling window is 128*SYSCLKOUT
EDIS;
EALLOW;
GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 15; // Xint1 is GPIO15
EDIS;
XIntruptRegs.XINT1CR.bit.POLARITY = 1; // rising edge interrupt
XIntruptRegs.XINT1CR.bit.ENABLE = 1; // Enable Xint1
/*设置XINT2*/
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO14 = 0; // GPIO
GpioCtrlRegs.GPADIR.bit.GPIO14 = 0; // input
GpioCtrlRegs.GPAQSEL1.bit.GPIO14 = 2; // XINT2 Qual using 6 samples
GpioCtrlRegs.GPACTRL.bit.QUALPRD1 = 0x80; // Each sampling window is 128*SYSCLKOUT
EDIS;
EALLOW;
GpioIntRegs.GPIOXINT2SEL.bit.GPIOSEL = 14; // Xint2 is GPIO14
EDIS;
XIntruptRegs.XINT2CR.bit.POLARITY = 1; // rising edge interrupt
XIntruptRegs.XINT2CR.bit.ENABLE = 1; // Enable Xint2
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
}
这个都是同一个组
后面清除时都是一起清的 之前没加定时器前是好的可以用的 中断里就改变标志位,
interrupt void ISRTimer0(void)
{
TCPTimeout=1;
EALLOW;
CpuTimer0Regs.TCR.bit.TIF=1;
CpuTimer0Regs.TCR.bit.TRB=1;
EDIS;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}
interrupt void xint1_isr(void)//外部中断1 采用GPIO口15 帧同步
{
EPwm1Regs.TBCTR=0;
t2=0;
EALLOW;
SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 1; // Start all the timers synced
EDIS;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}
interrupt void xint2_isr(void)//外部中断2 采用GPIO口14 窑同步
{
static int i;
Frame=1;//窑同步信号
r=1;
ava=r;
for(i=0;i >4;
if (t2==2500)
{
EALLOW;
SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 0; // Stop all the timers synced
EDIS;
ADflag=1;//采集数据结束标志
t2=0;
// GpioDataRegs.GPATOGGLE.bit.GPIO1 = 1; // Toggle GPIO1 once LED2亮灭亮灭
}
AdcRegs.ADCST.bit.INT_SEQ1_CLR=1;//清除中断标志位
AdcRegs.ADCTRL2.bit.RST_SEQ1=1;//复位排序器
PieCtrlRegs.PIEACK.all=PIEACK_GROUP1;//清除应答标志位
}