完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
我正在做一个电路的示例项目,我将布局(将使用PIC32 MZ)。所以我使用的是HARMony pin配置管理器,但我就是无法弄清楚(我使用的是.ony、configurator等的所有最新版本)。假设我想配置以下几个pinsas:RG15:LED_ALARM,output,lowRA5:PA._SWITCH,input,pullup onRE5:MOTOR_DRIVE,output,low所以我在MHC配置器PIN SETtiNGS TAB中设置所有这些,并选择希望使用UART&一些uart选项&点击代码ge嵌套按钮。到目前为止没问题……一堆文件神奇地出现了。现在,我怎么/在哪里编写代码来打开LED_ALARM?即使我输入app.c或m a in.c,这个名称似乎在任何地方都不会自动“弹出”……我是否遗漏了某些内容(比如需要手动拉入头文件?)好像它还没有“学会”我的PIN名字。我是否使用适当的程序来命名配置器中的PIN?我找不到在PIN配置器文档中描述任何地方的过程!我四处寻找关于用配置器设置基本引脚I/O的协调信息,但是找不到????
以上来自于百度翻译 以下为原文 I am doing a sample project for a circuit I will layout (will use a pic32Mz). So I am using the Harmony pin configuration manager, but I simply can't figure it out (I am using all of the latest versions of harmony, configurator, etc). Say I want to configure a few pins as the following: RG15: LED_ALARM, output, low RA5: PANIC_SWITCH, input, pull up on RE5: MOTOR_DRIVE , output, low So I set all of this up in the MHC configurator PIN SETTINGS TAB, along with selecting my desire to use the UART & some uart options & hit the code generation button. No problem so far...a bunch of files magically appear. Now how/where do I, say, write a line of code to turn on my LED_ALARM? The name does not seem to auto "pop up" anywhere even when I'm typing in either my app.c or main.c ...did I leave something out (such as needing to manuall pull in a header file?) It's as though it hasn't "learned" my pin names. Am I using the proper procedure to name my pins in the configurator? I can't find the procedure described anywhere in the pin configurator documentation! I looked around for Harmony info on setting up basic pin I/O with the configurator, but couldn't find it??? |
|
相关推荐
7个回答
|
|
|
你用什么牌子的?板支持包?Digilents的WF32板:http://micro..wikidot.com/.ony:.-labs的一个示例,因为我使用了BSP包,所以LED3可以称为BSP_LED_3I,可以从main.c app.c:BSP_LEDToggle(BSP_LED_3)调用app.c;我第一次经历的时候,我一直在想“这个状态机的东西是什么,我只想切换LED”。稍后,当试图保持一切正常时,状态机很有意义,所以就跟着流程走。我犯的其它错误是没有使用BSP。没有定义任何内容,并且我试图强制使用pin,所以直到我想到和谐定义(喜欢右键单击名称以查看调用映射)时,它才令人沮丧!售价69美元的WF32板是一个不错的介绍板。让我们知道你使用的开发板,所以我们可以使用相同的BSP命名。
以上来自于百度翻译 以下为原文 What board are you using? Board Support Package? An example with Digilents's WF32 board: http://microchip.wikidot.com/harmony:intro-labs Since I used the BSP package, LED3 can be called BSP_LED_3 I can call app.c from main.c app.c: BSP_LEDToggle(BSP_LED_3); Read through the entry labs. First time I went through I kept thinking "what is with this state machine stuff, I just want to toggle the LED's". Later the state machine makes a lot of sense when trying to keep everything straight, so just go with the flow. Other mistake I made was NOT using a BSP. Nothing was defined and I was attempting to force a pin, so it was frustrating until I thought in terms of Harmony definitions (love that right click over a name to see the call map!) The WF32 board for $69 is a decent intro boards. Let us know what development board you are using, so we can use he same BSP naming. |
|
|
|
|
|
你用什么牌子的?板支持包?Digilents的WF32板:http://micro..wikidot.com/.ony:.-labs的一个示例,因为我使用了BSP包,所以LED3可以称为BSP_LED_3I,可以从main.c app.c:BSP_LEDToggle(BSP_LED_3)调用app.c;我第一次经历的时候,我一直在想“这个状态机的东西是什么,我只想切换LED”。稍后,当试图保持一切正常时,状态机很有意义,所以就跟着流程走。我犯的其它错误是没有使用BSP。没有定义任何内容,并且我试图强制使用pin,所以直到我想到和谐定义(喜欢右键单击名称以查看调用映射)时,它才令人沮丧!售价69美元的WF32板是一个不错的介绍板。让我们知道你使用的开发板,所以我们可以使用相同的BSP命名。
以上来自于百度翻译 以下为原文 What board are you using? Board Support Package? An example with Digilents's WF32 board: http://microchip.wikidot.com/harmony:intro-labs Since I used the BSP package, LED3 can be called BSP_LED_3 I can call app.c from main.c app.c: BSP_LEDToggle(BSP_LED_3); Read through the entry labs. First time I went through I kept thinking "what is with this state machine stuff, I just want to toggle the LED's". Later the state machine makes a lot of sense when trying to keep everything straight, so just go with the flow. Other mistake I made was NOT using a BSP. Nothing was defined and I was attempting to force a pin, so it was frustrating until I thought in terms of Harmony definitions (love that right click over a name to see the call map!) The WF32 board for $69 is a decent intro boards. Let us know what development board you are using, so we can use he same BSP naming. |
|
|
|
|
|
正如我提到的,我没有使用任何板(没有购买的微芯片板,因为我的I/O设备看起来一点都不像它们,比如电机驱动)……这是我自己的设计,所以假设有一个芯片和开关、led等等。我如何使用引脚配置器设置所有的I/O????我假设这是用来建立I/O.的方法。
以上来自于百度翻译 以下为原文 As I mentioned, I am not using any board (no purchased microchip board, since my I/O devices will not look at all like any of them, such as motor driving)...this will be my own design, so just assume a chip and the switches, leds, etc. How do I set up all of my I/O using the pin configurator??? I assume that is what is to be used to set up the I/O. |
|
|
|
|
|
您可以使用PIN配置器来配置端口。使用它不是恶意的。您还可以直接使用库函数或直接使用寄存器。
以上来自于百度翻译 以下为原文 You can use the pin configurator to configure the ports. It is not mantitory to use it. You can also use the library functions directly or use the registers directly |
|
|
|
|
|
我所有的工作都是定制设计。在该引脚的管脚设置行中,我将“Name”设置为GPIO_OUT_DAC_RESET,“Function”设置为GPIO_OUT,“Direction(TRIS)”设置为Out,“.(ANSEL)”设置为数字化管脚,然后对锁存(LAT)、开式排水(ODC)、上拉(CNPU)、下拉(CNPD)进行任何设置。当我生成代码时,所得到的system_config.h包含(除许多其他事情之外):/***GPIO_OUT_OUT_DAC_DAC_DAC_RESRESRESETpin(GPIO_OUT_DAC_DAC_RESET_RESET pin****//656565***GPIO/***GPIO_OUT_OUT_OUT_DAC_DAC_RESET pin GPIO GPIO_DAC_RESET pin GPIO GPIO_DAC_RESET._RESET pin*********///\****/\******/\656565656565RT_PORTS_BIT_POS_POS_POS_POS_7)#定义GPIO_OU_OU_DAC_DAC_POS_POS_POS_7)#定义GPIO_BI_BI_PO_POS_POS_POS_BI_POS_POS_POS_POS_POS_POS_7)#定义GPIO_OU_OU_OU_OU_OUT_OUT_DAC_DAC_POS_POS_POS_POS_POS_POS_POS_POS_POS_7)\#定义GPIO_OU_OU_OU_OU_OU_OU_OU_定义GPIO_OUT_DAC_RESETStateSet(Value)PLIB_PORTS_PinWrite(PORTS_ID)_0,PORT_CHANNEL_H,PORTS_BIT_POS_7,Value)所以在我的代码中,我可以调用GPIO_OUT_DAC_RESETOn()来设置pin high,GPIO_OUT_DAC_RESETOff()来设置pin low。代码需要包含这个文件,或者包含这个文件的另一个文件来“查看”这些定义。交替地,你可以决定避开整个事情,只需直接调用PLIbxPosisPin StUSER()和PLIPHPurthsPin()函数,但具有定义并能够修改它们。通过仔细地点击图形表中的东西是有帮助的,一旦你掌握了它的定义。如果这些定义没有被生成,就会丢失一些东西。当我忘记给PIN一个名字(名字列)时,我看到了这种情况。您应该验证“使用端口系统服务”在“协调框架配置”->系统服务-gt;端口中的选项选项卡中检查。没有这个,它不会生成代码来设置PPS,并且没有外围设备将工作。在最初创建项目时,不选择一个板模型也是可能的。不知何故,我的板模型列表中有一个名为“自定义板”的项目。我不记得是我键入的还是它是一个和声设置,但这是我经常选择的。顺便说一下,当MHC产生这些定义时,如果它能产生三个附加的话,那将是很有帮助的。对于上面的GPIOUTUXDACHRead示例,如果它自动生成:将定义为GPIOUTAXDACHRESETHETPORTSUID ID PosisSIDID0,定义GPIOUTA DACHRESETHETPORTH通道PoTURL CHANNELL,定义GPIOUTA DACHRESETHETPORTSY BITPYPOS PORTSITBITPOSSY7。函数的参数,例如,当您有多个PIN执行类似的功能时,您需要动态地决定在运行时切换哪个函数。
以上来自于百度翻译 以下为原文 All my work is with custom designs. There are supposed to be #defines in system_config.h (under Header Files -> app -> system_config -> default (or whatever your configuration name is) -> system_config.h for your pins. For example, on my board, RH7 is a RESET pin for a DAC. On the Pin Settings row for that pin, I set "Name" to GPIO_OUT_DAC_RESET, "Function" to GPIO_OUT, "Direction (TRIS)" to Out, "Mode (ANSEL)" to Digital, and then whatever settings you want for Latch (LAT), Open Drain (ODC), Pull Up (CNPU), Pull Down (CNPD). When I generate code, the resulting system_config.h contains (among many other things): /*** Functions for GPIO_OUT_DAC_RESET pin ***/ #define GPIO_OUT_DAC_RESETToggle() PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_H, PORTS_BIT_POS_7) #define GPIO_OUT_DAC_RESETOn() PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_H, PORTS_BIT_POS_7) #define GPIO_OUT_DAC_RESETOff() PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_H, PORTS_BIT_POS_7) #define GPIO_OUT_DAC_RESETStateGet() PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_H, PORTS_BIT_POS_7) #define GPIO_OUT_DAC_RESETStateSet(Value) PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_H, PORTS_BIT_POS_7, Value) So in my code, I can call GPIO_OUT_DAC_RESETOn() to set the pin high, GPIO_OUT_DAC_RESETOff() to set the pin low. The code needs to #include this file, or another file that includes this file, to "see" these definitions. Alternately you can decide to eschew the whole thing and just call the PLIB_PORTS_PinSet() and PLIB_PORTS_PinClear() functions directly, but having the definitions and being able to modify them by (carefully) clicking on things in a graphical table is helpful, once you get the hang of it. If the definitions are not being generated, something is missing. I saw this occur when I forgot to give pins a name (in the Name column). You should verify that "Use Ports System Service" is checked in the Options tab under Harmony Framework Configuration -> System Services -> Ports. Without this, it won't generate the code to set up the PPS and no peripherals will work. It is also possible that not selecting a board model when initially creating the project messes something up. Somehow my list of board models has an item called "custom board" in it. I don't remember if I typed that or if it's a Harmony setting, but that's the one I always select. By the way, when MHC generates these defines, it would be helpful if it could generate three additional ones. For the above GPIO_OUT_DAC_RESET example, it would be helpful if it would automatically generate: #define GPIO_OUT_DAC_RESET_PORTS_ID PORTS_ID_0 #define GPIO_OUT_DAC_RESET_PORT_CHANNEL PORT_CHANNEL_H #define GPIO_OUT_DAC_RESET_PORTS_BIT_POS PORTS_BIT_POS_7 This way code can easily pass these things as arguments to functions, when for example you have multiple pins doing similar functions and you want to dynamically decide which to toggle at runtime. |
|
|
|
|
|
感谢12pm:或者,您可以决定避开整个过程,直接调用PLIB_PORTS_PinSet()和PLIB_PORTS_PinClear()函数,....这是我不得不求助的,但是它完全忽略了Harmony(或者至少忽略了pin配置器,它被认为是benfit中的一个)。一旦你掌握了它的诀窍……这就是我想要的,所以如果我在引脚配置器中将电机驱动器的名称从RG15移动到RE6,那么我的代码本身就会有帮助。会自动做出所有需要的改变…这是正确的想法吗?现在我只是使用常规的I/O来启动(比如led&.),完全没有外围设备。您应该验证“使用端口系统服务”在“协调框架配置”->系统服务-gt;端口中的选项选项卡中检查。没有这个,它不会生成用于设置PPS的代码,并且没有外围设备可以工作……我将检查一下。例如,在我的板上,RH7是一个DAC的RESET引脚。在该引脚的管脚设置行中,我将“Name”设置为GPIO_OUT_DAC_RESET,“Function”设置为GPIO_OUT,“Direction(TRIS)”设置为Out,“.(ANSEL)”设置为数字化管脚,然后对锁存(LAT)、开式排水(ODC)、上拉(CNPU)、下拉(CNPD)进行任何设置。当我生成代码时,所产生的SyrSyFig .h包含(包括许多其他东西):我正在设置我的PIN名称和所有选项(I/OUT,PULLUP等等)……但是我从来没有找到任何地方(在任何自动生成的文件中)我的PIN名称,所以当然没有什么会弹出的。列出我想输入和使用我的名字的时候。你知道PIN配置器文档是否显示了这样做的例子(定义你的I/O)?
以上来自于百度翻译 以下为原文 Thanks twelvepm: Alternately you can decide to eschew the whole thing and just call the PLIB_PORTS_PinSet() and PLIB_PORTS_PinClear() functions directly, ....This is what I had to resort to, but it then totally ignores Harmony (or at least the pin configurator, which is supposedly one of the benfit of the whole package but having the definitions and being able to modify them by (carefully) clicking on things in a graphical table is helpful, once you get the hang of it....That is what I want, so if I move the name of motor drive from say RG15 to RE6 in the pin configurator, then my code itself would automatically make all the needed changes..is this correct thinking? Right now I am just using regular I/O for starting out, (such as leds & switches), no peripherals at all. You should verify that "Use Ports System Service" is checked in the Options tab under Harmony Framework Configuration -> System Services -> Ports. Without this, it won't generate the code to set up the PPS and no peripherals will work..I will check this out. For example, on my board, RH7 is a RESET pin for a DAC. On the Pin Settings row for that pin, I set "Name" to GPIO_OUT_DAC_RESET, "Function" to GPIO_OUT, "Direction (TRIS)" to Out, "Mode (ANSEL)" to Digital, and then whatever settings you want for Latch (LAT), Open Drain (ODC), Pull Up (CNPU), Pull Down (CNPD). When I generate code, the resulting system_config.h contains (among many other things): I was setting my pin names & all of the options (in/out, pullup, etc) ...but I never could find where anything (in any of the auto generated files) with my pin names, so of course nothing would "popup" in a list when I wanted to type & use my names. Do you know if the pin configurator documentation shows any such examples of doing this (defining your I/Os)? |
|
|
|
|
|
有些情况下,定义不会生成。这件事发生在我身上,但我记不清是怎么回事了。也许这里有人知道,与此同时,我突然想到了什么。在PIN表(它出现在同一窗格中作为输出、动作项等),在其自己的选项卡中,确保有一个段(行)称为板支持包,并且您想要的PIN显示为GPIOUTOUT行中的绿色(赋值)。如果不是,我认为这会阻止定义在StulySigFig .h中出现。如果修复了它,那么您就知道如何修复缺失的定义的其余部分。-)
以上来自于百度翻译 以下为原文 There is some circumstance where the defines do not get generated. It happened to me at some point but I can't remember what fixed it. Maybe someone here knows. Meanwhile, something just occurred to me. In Pin Table (which appears in the same pane as Output, Action Items, etc., in its own tab), make sure there is a section (of rows) called Board Support Package and that the pin you want shows up as green (assigned) in the row for GPIO_OUT. If not, I think that would prevent the defines from showing up in system_config.h. If that fixes it, then you know how to fix the rest of the missing defines. :-) |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
508 浏览 0 评论
5813 浏览 9 评论
2351 浏览 8 评论
2238 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3545 浏览 3 评论
1161浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1122浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
890浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
508浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-15 04:04 , Processed in 3.582094 second(s), Total 85, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1846