我在调试的时候发现程序开始printf可以正常输出,但后面的printf无输出 请问这什么情况会导致串口刚开始有输出,PWM中断照样运行 就是不知道问题出在哪里 我把代码贴出来,麻烦给予指导,谢谢!
void main(void)
{
// uint8_t print_cnt1=0,print_cnt2=0;
// Step 1. Initialize System Control:b
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the DSP2803x_SysCtrl.c
InitSysCtrl();
// Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
DINT;
// Initialize PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.
// This function is found in the DSP2803x_PieCtrl.c file.
InitPieCtrl();
// Disable CPU interrupts and clear all CPU interrupt flags:
IER = 0x0000;
IFR = 0x0000;
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
// This will populate the entire table, even if the interrupt
// is not used in this example. This is useful for debug purposes.
// The shell ISR routines are found in DSP2803x_DefaultIsr.c.
// This function is found in DSP2803x_PieVect.c.
InitPieVectTable();
// Copy time critical code and Flash setup code to RAM
//实现在RAM中运行代码的搬运,例如使用官方的DELAY_US
MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);
InitMyGPIO();
InitKEY();//按键
SCI_Init();//波特率128000bps
open_uart_debug();
EALLOW;
PieVectTable.EPWM4_INT = &epwm4_isr;
EDIS;
InitEPWM_AQ_DB();
printf("\r\n\r\n\r\nDSP is Ready");//标准C的printf输出测试,串口调试助手设置波特率128000bps,ASCII格式显示
i=1;
printf("\r\n开发板左上角的J4排针(3针),用跳线帽短接靠左的2根针,即为将RG接入到模拟输入口B3");
printf("\r\nPWM频率为19.6KHZ");
//中断配置步骤-----5
PieCtrlRegs.PIEIER3.bit.INTx4 = 1; // Enable the PIE block
PieCtrlRegs.PIECTRL.bit.ENPIE = 1; // Enable the PIE block
IER |= M_INT3;
EINT; // Enable Global interrupt INTM
ERTM;//请参看 使用须知 文件夹下的 分享--ERTM、DRTM 在DSP编程中的作用.pdf
printf("\r\nPWM频率为20KHZ 两路PWM");
while(1)
{
}
}