完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
目标单片机PIC18F14K22传输机MCP2021A作为从机;MCPIC16F1718传输机MCP2021A作为主控开发工具:MPLAB X4.20/XC8 1.45/MCC 3.55.1/LIN驱动程序V2.3/库版本V1.65.2 FPIC10/12/16/18 MCU背景:几天前,我提交的题目是关于MCC Lin驱动程序的问题。RY V2.3“我使用PIC 16F1718作为主总线和从设备的LIN总线,在我得到支持之后它们工作得很好,现在我尝试使用PIC 18F14K22作为LIN总线的从属而不是PIC16F1718,我发现UART接口有问题(不能运行到接收中断服务例程)。虽然我已经在MCC和主循环中启用了中断(ununand全局和外围中断)time0中断(LIN看门狗)是可以的,但是EUART中断事件不能被捕获:PIC 18F14K22空隙中断初始化的PIC中程兼容模式(空隙){//禁用中断优先级向量(16CXXX兼容模式)RCONTITION(IPEN=0);}中断中断(中断)管理器(空隙){//中断处理程序(ItCONBITS.TMR0IE=1和&;Tim0IF=1){TMR0IISR());否则,(IncBITS.PEI= 1){if(Py1BIT.TXY==1和AMP)否则,如果(Py1BITS.RCIE=1和&;和PIP1BITS.RCIF=1){EUARARTHORXDeFultStULTHANDHANDLE();}{ / /未处理中断} { / /未处理中断} /**文件** /现在我找不到根本原因,请他LP我!提前谢谢!
以上来自于百度翻译 以下为原文 Target MCU PIC18F14K22 Tranceiver MCP2021A as slave ;MCU PIC16F1718 Tranceiver MCP2021A as Master development tools :MPLAB x 4.20/XC8 1.45/MCC 3.55.1/LIN driver V2.3 / Library version V1.65.2 for Pic10/12/16/18 MCUs Background :A few days ago ,i submit the topic "Question about MCC Lin driver liabrary V2.3" i used PIC 16F1718 as LIN_BUS both for master and slave , and they worked well after i got support and now i try to use PIC 18F14K22 as LIN BUS slave instead of PIC16F1718 I found the EUART interrup has problem (can not run into receive interrupt sevice routin) though i have enabled the interrupt both in MCC and main loop (uncoment the Global and Peripheral Interrupts) Time0 interrupt (LIN watchdog) is Ok ,but EUART interrupt event could not be captured note : I use the PIC Mid-Range Compatibility Mode for PIC 18F14K22 void INTERRUPT_Initialize (void) { // Disable Interrupt Priority Vectors (16CXXX Compatibility Mode) RCONbits.IPEN = 0; } void interrupt INTERRUPT_InterruptManager (void) { // interrupt handler if(INTCONbits.TMR0IE == 1 && INTCONbits.TMR0IF == 1) { TMR0_ISR(); } else if(INTCONbits.PEIE == 1) { if(PIE1bits.TXIE == 1 && PIR1bits.TXIF == 1) { EUSART_TxDefaultInterruptHandler(); } else if(PIE1bits.RCIE == 1 && PIR1bits.RCIF == 1) { EUSART_RxDefaultInterruptHandler(); } else { //Unhandled Interrupt } } else { //Unhandled Interrupt } } /** End of File */ and now I could not find the root cause , please help me ! Thank you in advance ! |
|
相关推荐
3个回答
|
|
UART RX在PIN RB5上,这也是一个11.那个PIN已经从模拟切换到数字模式吗?
以上来自于百度翻译 以下为原文 UART RX is on pin RB5, which is also AN11. Has that pin been switched from analog to digital mode? |
|
|
|
非常感谢你!你是对的!MCC没有生成ANSELX的代码,虽然我已经设置AN11作为数字输入。
以上来自于百度翻译 以下为原文 Thank you very much! You are right ! The MCC did not generate the code for ANSELx,though i have set the AN11 as digital input |
|
|
|
这应该被报告(AH啊)到微芯片开发商,因为这是第二次在几天内出来。
以上来自于百度翻译 以下为原文 This should be reported (ah ah) to Microchip Developers, since it's the second time in a few days that comes out. |
|
|
|
只有小组成员才能发言,加入小组>>
5248 浏览 9 评论
2036 浏览 8 评论
1956 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3218 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2264 浏览 5 评论
787浏览 1评论
678浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
604浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
685浏览 0评论
582浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 16:29 , Processed in 1.820599 second(s), Total 79, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号