⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dsp28_defaultisr.c

📁 DSP IO控制
💻 C
📖 第 1 页 / 共 3 页
字号:
	}
	
	else if ((T2CNT_COUNT2 - T2CNT_COUNT1) > 30000.0)
	{	
		i2++;
		Vel = 60000.0 - T2CNT_COUNT2 + T2CNT_COUNT1;
	}
	
	else 
	{
		i3++;
		Vel = T2CNT_COUNT1 - T2CNT_COUNT2;
	}
	
	V_min_double = 60.0*(Vel/sampletime/4.0/500.0);
	V_min = (int)V_min_double;
	
	timer111[jjj] = V_min;
	jjj++;
	
	V_low = V_min & 0x00FF;
	
	V_high = V_min >> 8;
	
	
	if (V_low == 0xFF)	//避免出现与头信号相同
	{
		V_low = 0xFE;
	}
		if (V_high == 0xFF)	//避免出现与头信号相同
	{
		V_high = 0xFE;
	}
	/*
	if (tminus1 > 30000)
	{	
		i1++;
		Vel = -(65535 - T2CNT_COUNT[1] + T2CNT_COUNT[2]);
	}
	
	else if (tminus2 > 30000)
	{	
		i2++;
		Vel = 65535 - T2CNT_COUNT[2] + T2CNT_COUNT[1];
	}
	
	else 
	{
		i3++;
		Vel = T2CNT_COUNT[1] - T2CNT_COUNT[2];
	}
	
	V_min_double = 60*(Vel/sampletime/4/500);
	V_min = (int)V_min_double;
	
	V_low = V_min & 0x00FF;
	
	V_high = V_min >> 8;
	
	
	if (V_low == 0xFF)	//避免出现与头信号相同
	{
		V_low = 0xFE;
	}
		if (V_high == 0xFF)	//避免出现与头信号相同
	{
		V_high = 0xFE;
	}*/
	/*
	T2CNT_COUNT2 = T2CNT_COUNT1;
	
	p_pitch = cap4_high;
	p_roll = cap6_high;
	p_height = cap3_high;
	p_oil = cap3_high;
	p_yaw = cap5_high;
	
	
	doublePitch = SPitchMin + (p_pitch - RPitchMin)*((SPitchMax - SPitchMin)/(RPitchMax-RPitchMin));
	doubleRoll = SRollMin + (p_roll - RRollMin)*(SRollMax - SRollMin)/(RRollMax-RRollMin);
	doubleYaw = SYawMin + (p_yaw - RYawMin)*(SYawMax - SYawMin)/(RYawMax-RYawMin);
	doubleOil = SThMin + (p_oil - RThMin)*(SThMax - SThMin)/(RThMax-RThMin);
	doubleMain = SMainMin + (p_oil - RThMin)*(SMainMax - SMainMin)/(RThMax-RThMin);
	
	intPitch = (int)doublePitch;
	intRoll = (int)doubleRoll;
	intYaw = (int)doubleYaw;
	intOil = (int)doubleOil;
	intMain = (int)doubleMain;
	
	
	EvaRegs.CMPR1 = intPitch;
	EvaRegs.CMPR2 = intRoll;
	EvaRegs.CMPR3 = intOil;
	EvbRegs.CMPR4 = intMain;
	EvbRegs.CMPR5 = intYaw;
	
	trans_msg_plus = 0xFF + cap4_high + cap6_high + cap3_high + cap5_high + V_low + V_high;
	
	
	if (SciaTx_Ready() == 1)
	{
		SciaRegs.SCITXBUF = 0xFF;
	}
	delay_loop1();
	if (SciaTx_Ready() == 1)
	{
		SciaRegs.SCITXBUF = cap4_high;
	}
	delay_loop1();
	if (SciaTx_Ready() == 1)
	{
		SciaRegs.SCITXBUF = cap6_high;
	}
	delay_loop1();
	if (SciaTx_Ready() == 1)
	{
		SciaRegs.SCITXBUF = cap3_high;
	}
	delay_loop1();
	if (SciaTx_Ready() == 1)
	{
	
		SciaRegs.SCITXBUF = cap5_high;
	}
	delay_loop1();

	//向串口发送转速信号  低8位
	if (SciaTx_Ready() == 1)
	{
		SciaRegs.SCITXBUF = V_low;
	}
	
	delay_loop1();

	//向串口发送转速信号   高8位
	if (SciaTx_Ready() == 1)
	{
		SciaRegs.SCITXBUF = V_high;
	}
	
	delay_loop1();

	//向串口校验位包括0XFF
	if (SciaTx_Ready() == 1)
	{
		SciaRegs.SCITXBUF = trans_msg_plus;
	}*/
	
  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  	EvbRegs.EVBIFRB.all=BIT0;
  	PieCtrl.PIEACK.all = PIEACK_GROUP5;

  // Next two lines for debug only - remove after inserting
  // ISR Code
  //asm ("      ESTOP0");
   //for(;;);
	EINT;
  // Uncomment this line after adding ISR Code 
  // return;
}

interrupt void T4CINT_ISR(void)    // EV-B
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP5;
 
  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}

interrupt void T4UFINT_ISR(void)   // EV-B
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP5;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}

interrupt void T4OFINT_ISR(void)   // EV-B
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP5;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}

interrupt void CAPINT4_ISR(void)   // EV-B
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP5;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}

interrupt void CAPINT5_ISR(void)   // EV-B
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP5;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}

interrupt void CAPINT6_ISR(void)   // EV-B
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP5;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);
  
  // Uncomment this line after adding ISR Code 
  // return;
}

//---------------------------------------------------------------------------
// McBSP-A Default ISRs: 
//
interrupt void MRINTA_ISR(void)     // McBSP-A
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP6;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}

interrupt void MXINTA_ISR(void)     // McBSP-A
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP6;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}

//---------------------------------------------------------------------------
// SPI-A Default ISRs: 
//
interrupt void SPIRXINTA_ISR(void)    // SPI-A
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP6;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}

interrupt void SPITXINTA_ISR(void)     // SPI-A
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP6;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}



//---------------------------------------------------------------------------
// SCI-A Default ISRs: 
//
interrupt void SCIRXINTA_ISR(void)     // SCI-A
{	/*
	iii++;
	PieCtrl.PIEACK.bit.ACK9 = 1;
	if (SciaRx_Ready() == 1) 
	{
		TempSci = SciaRegs.SCIRXBUF.all;
	
	
	if( (Sciflag==1) || (TempSci == 0xFF) )
	{
		msg[ind++] = TempSci;
		Sciflag = 1;
		
		if (ind == 7)
		{
			msgplus = ((msg[1] + msg[2] + msg[3] + msg[4] + msg[5]) & (0x00FF));
			if (msg[6] == msgplus)
			{
				EvaRegs.CMPR1 = msg[1] * 10;
				EvaRegs.CMPR2 = msg[2] * 10;
				EvaRegs.CMPR3 = msg[3] * 10;
				EvbRegs.CMPR4 = msg[5] * 10;
				EvbRegs.CMPR5 = msg[4] * 10;
			}
				Sciflag = 0;
				ind = 0;
			
		}
	}	
	}

		/*EvaRegs.CMPR1 = SciaRegs.SCIRXBUF.all*10;
		j++;
		if(j == 100)
		{
			j = 0;
		}*/
	
	EINT;
}

interrupt void SCITXINTA_ISR(void)     // SCI-A
{  	
	PieCtrl.PIEACK.bit.ACK9 = 1;
	EINT;
}


//---------------------------------------------------------------------------
// SCI-B Default ISRs: 
//
interrupt void SCIRXINTB_ISR(void)     // SCI-B
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP9;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}

interrupt void SCITXINTB_ISR(void)     // SCI-B
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP9;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}


//---------------------------------------------------------------------------
// CAN-A Default ISRs: 
//
interrupt void ECAN0INTA_ISR(void)  // eCAN-A
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP9;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}

interrupt void ECAN1INTA_ISR(void)  // eCAN-A
{
  // Insert ISR Code here

  // To recieve more interrupts from this PIE group, acknowledge this interrupt 
  // PieCtrl.PIEACK.all = PIEACK_GROUP9;

  // Next two lines for debug only - remove after inserting
  // ISR Code
   asm ("      ESTOP0");
   for(;;);

  // Uncomment this line after adding ISR Code 
  // return;
}


//---------------------------------------------------------------------------
// Catch All Default ISRs: 
//
interrupt void PIE_RESERVED(void)  // Reserved space.  For test.
{
  asm ("      ESTOP0");
  for(;;);
}

interrupt void rsvd_ISR(void)          // for test
{
  asm ("      ESTOP0");
  for(;;);
}

//===========================================================================
// No more.
//===========================================================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -