完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
|
大家好,我是Linux上的MPLAB v 3.35和XC8编译器v1.38的新用户(按照微芯片说明安装),我尝试了一些示例,当我使用这些函数Delay10KTCYx()和_u._ms()时,我有错误需要编译;当我使用Delay10KTCYx(250);(在10M晶体中延迟1s)al)我得到了compilermain.c:21的以下消息:警告:(361)函数声明为隐式int//引用Delay10KTCYx/opt/micro./xc8/v1.38/./pic18/d10ktcyx.c:8:错误:(1098)变量“_Delay10KTCYx”(main.c:21)声明冲突(908)退出状态=1When我使用_u._ms(1000);我得到了编译器的以下信息。c:21:错误:(1355)联机延迟参数太大。c:23:错误:(1355)联机延迟参数太大,我试图用PIC18F2550、PIC18F4550、PIC18F8722创建具有相同结果的项目……我做错了什么?(我附上这个项目)我也想收到关于MPLAB和XC8的建议!当做
以上来自于百度翻译 以下为原文 Hello to all, I'm new User of MPLAB v 3.35 and XC8 Compiler v1.38 on Linux(installed following the Instructions of Microchip), I tried some examples and I had errors to compile when I use these functions Delay10KTCYx() and __delay_ms(); When I use Delay10KTCYx(250); (for a delay of 1s in a 10M Crystal) I got the following message of the compiler main.c:21: warning: (361) function declared implicit int //Refering to the line of Delay10KTCYx /opt/microchip/xc8/v1.38/sources/pic18/d10ktcyx.c:8: error: (1098) conflicting declarations for variable "_Delay10KTCYx" (main.c:21) (908) exit status = 1 When I use __delay_ms(1000); I got the following message of the compiler main.c:21: error: (1355) in-line delay argument too large main.c:23: error: (1355) in-line delay argument too large I tried to create projects with PIC18F2550, PIC18F4550, PIC18F8722 with the same result... What am I doing wrong? (I attach the project) Also I would like to receive advices about MPLAB and XC8! Regards Attachment(s) LEDS.X.zip (74.56 KB) - downloaded 117 times |
|
相关推荐
3个回答
|
|
|
不阅读编译器附带的用户手册。它确切地告诉您PIC18F芯片上的_u._ms()宏的限制。您必须在循环中调用它,以获得多个更短的延迟。
以上来自于百度翻译 以下为原文 Not reading the user manual that comes with the compiler. It tells you exactly the limitations of the __delay_ms() macro on a PIC18F chip. You will have to call it in a loop, to get multiple shorter delays. |
|
|
|
|
|
Delay10ktCyx不是由XC8编译器提供的函数。这就是为什么它认为你正在定义一个变量两次。它是一个用旧的Microchip C18编译器提供的函数。XC8不是100%与C18兼容。
以上来自于百度翻译 以下为原文 Delay10KTCYx is not a function supplied by the XC8 compiler. That is why it thinks you are defining a variable twice. It was a function supplied with the old Microchip C18 compiler. XC8 is not 100% compatible with C18. |
|
|
|
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1123浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 01:45 , Processed in 0.638927 second(s), Total 78, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1163