完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,我想在PIC18F4620上启用USAT RX中断。每当我提到PrI1BITS.RCIF时,就会得到以下错误:如果我注释了这行,它就成功编译了。这是代码:编译器是XC8 V1.44,MPLAB X IDE 4.01。OS是LimuxMin 18.3,64位你能告诉我我做错了什么吗?提前感谢!
以上来自于百度翻译 以下为原文 Hi, I'm trying to enable USART Rx interrupt on PIC18F4620. Whenever I refer to PIR1bits.RCIF, I get the following error: /opt/microchip/xc8/v1.44/include/pic18f4620.h:2848: error: (1098) conflicting declarations for variable "_PIR1bits" (/opt/microchip/xc8/v1.44/include/pic18f4620.h:2594) (908) exit status = 1 If I comment out that line, it compiles successfully. This is the code: void Init_peripherals(){ OpenI2C( MASTER, SLEW_OFF); SSPADD = 19;//100kHz Baud clock @8MHz TXSTA = 0x24; // SYNC=0 RCSTA = 0x10; BAUDCON = 0x08; SPBRGH = 0; SPBRG = 16; INTCONbits.GIE = 0; // disable all interrupts PIE1bits.RCIE = 1; // enable UART Rx interrupt INTCONbits.PEIE = 1; // enable peripheral interrupts RCONbits.IPEN = 1; // enable high priority interrupts IPR1bits.RCIP = 1; // enable high priority for Rx interrupt INTCONbits.GIE = 1; // enable global interrupts PIR1bits.RCIF = 0; // reset flag RCSTAbits.SPEN = 1; } The compiler is XC8 v1.44, MPLAB X IDE 4.01. OS is LinuxMint 18.3, 64 bit Can you please tell what am I doing wrong? Thanks in advance! |
|
相关推荐
7个回答
|
|
您安装了可选的外围库吗?自从XC8 V1.34以来,它们一直没有被维护,自那时起,一些头文件已经发生了变化。
以上来自于百度翻译 以下为原文 Have you installed the optional peripheral libraries? They have not been maintained since XC8 v1.34, and some header files have changed since then. A search of this board for that error should find various proposed solutions. |
|
|
|
哦!我在论坛中搜索了一个类似的线程:http://www. McCys.com /论坛/ M108539。ASPXI将安装XC8 V1.34并查看它如何运行。谢谢你的回复!
以上来自于百度翻译 以下为原文 Oh! I searched the forum and came across a similar thread: http://www.microchip.com/forums/m1028539.aspx I'll install XC8 v1.34 and see how it goes. Thanks for the reply! |
|
|
|
安装XC8 V1.34和编译的伎俩!谢谢。如果Microchip不再支持XI8新版本的PLIB,他们的新产品MCC不应该支持18F4620设备吗?IIRC,MCC不支持我的设备。
以上来自于百度翻译 以下为原文 Installing XC8 v1.34 and compiling did the trick! Thank you. If Microchip has stopped supporting PLIB in newer versions of XC8, shouldn't their new product MCC support 18f4620 devices? IIRC, MCC did not support my device. |
|
|
|
为什么不切换到像PIC18F46K22或K42那样的新PIC?他们比较便宜,有更多的特点,并得到了MCC的支持。无论如何,如果你想留在这个古老的PICK,为什么不停留在古老的编译器版本;
以上来自于百度翻译 以下为原文 Why not switch to a newer PIC like PIC18F46K22 or K42? They are cheaper, have more features and are supported by MCC. Anyway, if you want to stay with this ancient PIC why not stay with ancient compiler version as well ;-) |
|
|
|
或者抛开图书馆的想法,只需编写功能来控制外围设备,大部分都很简单,还有很多例子可供参考。
以上来自于百度翻译 以下为原文 Or toss the libraries idea and just write fuctions to control the peripherals yourself, most of them are pretty simple and there are LOTS of examples available. |
|
|
|
是的,甚至可以简单地使用来自PLIB库的函数源代码…
以上来自于百度翻译 以下为原文 Yep, it is even possible to simply use the functions source code coming with the PLIB libraries ... |
|
|
|
嗯,我使用的是古老的图片,因为我有一些这样的谎言,十年前,当微芯片用来发送免费样品。现在他们收取的是名义费用,不是吗?总之,如果我需要一个更好的UC,我会放弃PIC,去LPC4000系列,因为我熟悉我的工作场所。
以上来自于百度翻译 以下为原文 Well, I use the ancient PIC since I have a few of these lying around from a decade ago when Microchip used to send *free* samples. Nowadays they charge a nominal fee, don't they? Anyway, if at all I'm in need of a better uC, I'd ditch the PIC and go for the LPC4000 series since I'm familiar with it from my workplace. |
|
|
|
只有小组成员才能发言,加入小组>>
5142 浏览 9 评论
1990 浏览 8 评论
1918 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3159 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2215 浏览 5 评论
710浏览 1评论
598浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
481浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
610浏览 0评论
508浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-10 13:28 , Processed in 0.979251 second(s), Total 57, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号