完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
好的,可能很简单,但是我不知道怎么做。我有一个现有的项目,我要搬到一个新的处理器上。为了节省时间(是的,对……),我想使用MCC来生成我需要的外围设备的驱动程序,在这种情况下是I2C,SPI和I2S总线。首先,如何访问它们?我尝试在代码中使用它们,并获得函数未定义的错误。我是否包括I2C2?h?MCC?H?以上没有?MCC当然不会添加任何文件来使用它们…
以上来自于百度翻译 以下为原文 Ok, probably simple, but I don't know how to do it. I have an existing project, which I am moving to a new processor. To try and save time (yeah, right...) I thought to use MCC to generate the drivers for the peripherals I need, in this case an I2C, and SPI and and I2S bus. First, HOW DO YOU ACCESS THEM? I tried using them in my code, and get function not defined errors. Do I include I2C2.h? MCC.h? none of the above? The MCC sure isn't adding anything to my files to use them... |
|
相关推荐
8个回答
|
|
你只需用MCC图形化配置你的外设,然后点击生成代码来生成你的驱动程序。在头和源文件夹下,你会看到MCC生成的文件。MCC应该生成一个.c文件,其中包含“McCyPrimeAddioStudio/McC.h”和StaseIn PrimalIZError(),如果你的主体不是MCC生成的,则包含“McCyPrimeAddioStudio/MCC.H”,以及StaseIn PrimalIZIDER(),如本教程所解释的。AI:从MPLAB代码配置器开始。
以上来自于百度翻译 以下为原文 You just have to configure your peripherals graphically with MCC then click on Generate Code to Generate your drivers. Under the Header and Source folder you'll see MCC Generated files. MCC should generate a Main.C file with #include “mcc_generated_files/mcc.h”, and SYSTEM_Initializer() If your main was not generated by MCC, #include “mcc_generated_files/mcc.h”, and SYSTEM_Initializer() as explained in this tutorial: Getting Started with MPLAB Code Configurator. |
|
|
|
好的,我只想给出更多的细节。首先,你需要添加这两个包含行和初始化器,但是你会得到两个主要功能的错误,一个在你原来的程序中,另一个来自新的MCC泛型的主C。当你删除MCC主时,你会得到链接错误,因为它希望它在那里。如果我将旧文件重命名为Maul.C,它要找到我的原始文件来编译!最后,我把原来的main()变成了一个命名的路由,并把它添加到MCC生成的main .c中,并做了大量的编辑来从我的原始文件中创建一个头文件(顺便说一下,它没有命名main .c!)三天后仍在编辑…
以上来自于百度翻译 以下为原文 Ok, just to give a few more details. First, you need to add those two include lines and initializers, but then you get errors of two main functions, one in your original program, and one from the new MCC genereated main.c. When you eliminate the MCC main, you get linker errors because it expects it to be there. If I then rename my old file to main.c, it wants to find my original file to compile! Finally, have ended up turning my original main() to a named routing, and added it to the MCC generated main.c, and did MASSIVE edits to create a header file from my original file (that was not named main.c by the way!) STILL EDITING after three days... |
|
|
|
嗨,打开一个A:不管.c文件,包含你的旧主程序到一个头文件,然后不得不编辑3天,听起来像是一个误解和错误。如果你的原程序文件中有空main(空){/……main函数,你可以避免由MCC创建的.c文件。转到“项目”面板,窗口左上部分。单击“+”以展开树,直到找到MCC生成的“源文件”和“Meal.C”。右击文件名,然后从“当前配置”中选择“排除文件”。或者您可以反过来做。在主C文件中有很多文本,以及您需要的几个片段。有一个包工具:指向项目三的根,面板左上角的IC包图标,Rightclick和SELECT包。然后有人会告诉你一切都是错的,尤其是那些DE。尾巴没有多大关系。迈西尔
以上来自于百度翻译 以下为原文 Hi, Turning a: whatever.c file, containing your old main program into a header file, and then having to edit for 3 days, sound like a misunderstanding and mistake. If there is: void main(void) { // ... main function in your original program file, you may avoid the main.c file that is created by MCC, by going to 'Projects' panel, upper left part of window. Click '+' to expand the tree until you find 'Source Files' and 'main.c' that is generated by MCC. Rightclick on the filename, and select: 'Exclude file(s) from current configuration'. Or you may do it the other way around. There is a lot of text, and a few pieces that you will need, in the main.c file created by MCC, . Or dump the entire project into a zipfile, and attach to a message. There is a Package tool: Point to the root of Project three, the IC package icon in upper left corner of panel, Rightclick and select Package. Then someone may tell you that everything is wrong, especially all those details that do not matter much. Mysil |
|
|
|
您必须张贴您的代码和完整的错误信息,这里有很多人可以帮助您,但需要更多的信息。
以上来自于百度翻译 以下为原文 You must post your code and full error messages, there are many people here in the Forum who could assist you but more information is required. |
|
|
|
有趣的是,排除配置不再可用,只删除!当然,这不排除它,它从计算机上删除!!!!!!!
以上来自于百度翻译 以下为原文 Interestingly, the exclude from configuration is no longer available, only delete! Of course that doesn't just exclude it, it removes if from the computer!!!!! |
|
|
|
你使用的是什么版本的MPLAX????我用MPLAB X V4.15运行,并且在本周使用了排除配置。还是在同一个面板中的“文件”选项卡中乱搞?请确保在面板中选择“项目”选项卡,它有一个IC包作为根目录图标。迈西尔
以上来自于百度翻译 以下为原文 What version of MPLAB X are you using??? I am running with MPLAB X v4.15, and have used Exclude from configuration this week. Or are you messing in the 'Files' tab in the same panel ? Make sure to select 'Projects' tab in the panel, it has a IC Package as Icon for the root. Mysil |
|
|
|
好的,在项目下。一定是在文件标签下。哦,编辑已经完成了!
以上来自于百度翻译 以下为原文 Ok, is under project. Must have been under file tab. Oh well, editing already done! |
|
|
|
您好,请使用MCC生成代码,一旦看到文件夹结构。这将使您清楚地知道如何将代码的一部分合并到MCC。您还可以理解由MCC定义的API并调整您的代码使用它。如果涉及到更多的复杂性,您可以提供更多的细节。
以上来自于百度翻译 以下为原文 Hi, Please generate the code using MCC once see the folder structure. That will give you a clear idea of how you can merge your part of the code to MCC. You can also understand the API's been defined by MCC and tweak your code to use it. If more complexity involved you can provide more details. Attached Image(s) |
|
|
|
只有小组成员才能发言,加入小组>>
5243 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3208 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2258 浏览 5 评论
779浏览 1评论
672浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
598浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
680浏览 0评论
578浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 13:28 , Processed in 1.273941 second(s), Total 58, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号