1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
研旭的28377D核心板。大神帮我看看哪里配置有问题,CCS9.0.1
我在EPWM1的中断ISR函数中让一个TEST++,但是无论是RAM还是FLASH,调试时都进不去EPWM中断,观察到TEST的值却为1,似乎是只进了一次中断,但在中断里设置断点后,又进不去断点。硬件是没有问题的,拿别的代码试过能进中断。下面是配置代码: 主函数: void main(void) { InitSysCtrl(); InitGpio(); // enable PWM1-6 CpuSysRegs.PCLKCR2.bit.EPWM1=1; CpuSysRegs.PCLKCR2.bit.EPWM2=1; CpuSysRegs.PCLKCR2.bit.EPWM3=1; CpuSysRegs.PCLKCR2.bit.EPWM4=1; CpuSysRegs.PCLKCR2.bit.EPWM5=1; CpuSysRegs.PCLKCR2.bit.EPWM6=1; InitEPwmGpio(); DINT; InitPieCtrl(); IER = 0x0000; IFR = 0x0000; EALLOW; PieVectTable.EPWM1_INT = &EPWM1_ISR; EDIS; EINT; ERTM; EALLOW; CpuSysRegs.PCLKCR0.bit.TBCLKSYNC = 0; EDIS; InitEPwm1();//初始化配置EPWM1-6 InitEPwm2(); InitEPwm3(); InitEPwm4(); InitEPwm5(); InitEPwm6(); delayms(100); EALLOW; CpuSysRegs.PCLKCR0.bit.TBCLKSYNC = 1; EDIS; IER |= M_INT3; PieCtrlRegs.PIEIER3.bit.INTx1 = 1; for (;;) { asm(" NOP "); } } InitEPwmGpio()//只放EPWM1的,其他是一样的 { EALLOW; /* Disable internal pull-up for the selected output pins for reduced power consumption */ // Pull-ups can be enabled or disabled by the user. // Comment out other unwanted lines. GpioCtrlRegs.GPAPUD.bit.GPIO0 = 1; // Disable pull-up on GPIO0 (EPWM1A) GpioCtrlRegs.GPAPUD.bit.GPIO1 = 1; // Disable pull-up on GPIO1 (EPWM1B) // GpioCtrlRegs.GPEPUD.bit.GPIO145 = 1; // Disable pull-up on GPIO145 (EPWM1A) // GpioCtrlRegs.GPEPUD.bit.GPIO146 = 1; // Disable pull-up on GPIO146 (EPWM1B) /* Configure EPWM-1 pins using GPIO regs*/ // This specifies which of the possible GPIO pins will be EPWM1 functional pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 1; // Configure GPIO0 as EPWM1A GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 1; // Configure GPIO1 as EPWM1B // GpioCtrlRegs.GPEMUX2.bit.GPIO145 = 1; // Configure GPIO145 as EPWM1A // GpioCtrlRegs.GPEMUX2.bit.GPIO146 = 1; // Configure GPIO0146 as EPWM1B EDIS; } InitEPwm1() { EPwm1Regs.TBPRD = TBPRDv; // TBPRDV=5000; EPwm1Regs.TBPHS.bit.TBPHS = 0x0000; // Phase is 0 EPwm1Regs.TBCTR = 0x0000; // Clear counter EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW; EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; EPwm1Regs.TBCTL.bit.CLKDIV = TB_DIV1; EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // Set Compare values EPwm1Regs.CMPA.bit.CMPA = TBPRDv>>2; // EPwm1Regs.CMPB = EPWM1_MIN_CMPB; // Set actions EPwm1Regs.AQCTL.bit.SHDWAQAMODE = CC_SHADOW; EPwm1Regs.AQCTL.bit.LDAQAMODE = CC_CTR_ZERO; / EPwm1Regs.AQCTLA.bit.CAU = AQ_SET; EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR; EPwm1Regs.DBCTL.bit.IN_MODE = DBA_ALL; EPwm1Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; EPwm1Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; // EPwm1Regs.DBCTL.bit.POLSEL = DB_ACTV_LOC; EPwm1Regs.DBRED.bit.DBRED = 10; EPwm1Regs.DBFED.bit.DBFED = 10; EPwm1Regs.ETCLR.bit.INT = 1; //Clear INT flag EPwm1Regs.ETSEL.bit.INTEN = 1; //Enable INT EPwm1Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; EPwm1Regs.ETPS.bit.INTPSSEL = 0x0; //select etps register EPwm1Regs.ETPS.bit.INTPRD = ET_1ST; } |
|
相关推荐
1个回答
|
|
没有用过这个板
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于 DSP5509 进行数字图像处理中 Sobel 算子边缘检测的硬件连接电路图
3237 浏览 0 评论
790 浏览 0 评论
普中科技F28335开发板中,如何使用aic23播放由代码生成的正弦波
3670 浏览 0 评论
4431 浏览 1 评论
1371 浏览 1 评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 02:38 , Processed in 0.456097 second(s), Total 63, Slave 57 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号