完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我对PIC编程很新,但我很喜欢它,并且愿意花一些时间和精力去学习新的东西。我正在寻找一种将信号从一个引脚重新路由到另一个的方法。我知道这可以用CLC来实现。我使用的是PIC16F1509和MPLAX X4.15,MCCI已经配置了CLC输入和输出。我想知道如何在主C程序中调用这个CLC?我只想在满足一定条件时才调用它。谢谢你的帮助。
以上来自于百度翻译 以下为原文 I'm new to PIC programming but really loving it and willing to put some time and effort to learn new stuff. I'm looking for a way to reroute a signal from one pin to another. I know this can be achieved using CLC. I'm using a PIC16F1509 and MPLAX X v4.15 with MCC I've configured the CLC input and output. I'm wondering how to invoke this CLC in the main.c program? I'd like to invoke it only when a certain condition is met. Thanks for your help |
|
相关推荐
5个回答
|
|
我想你可能需要更具体地说明这一点:“我正在寻找一种方法来将信号从一个引脚重新路由到另一个。”这个:“我想知道如何在主C程序中调用这个CLC?”
以上来自于百度翻译 以下为原文 I think you may need to be more specific about what this means: "I'm looking for a way to reroute a signal from one pin to another." And this: "I'm wondering how to invoke this CLC in the main.c program?" |
|
|
|
如果您已经在MCC中正确配置了CLC和PIN管理器,那么唯一需要做的就是“调用”它(而不是我的经验中的一个标准C术语),就是调用初始化例程来设置所有寄存器。我还没有使用MCC,但我似乎记得Meal.C已经通过调用“StimeSuinit()”(或类似的东西)来初始化这个初始化,这个init函数调用所有的单独的模块init函数。
以上来自于百度翻译 以下为原文 If you have configured the CLC and Pin Manager correctly in MCC, then the only thing that needs to be done to "invoke" it (not a standard C terminology in my experience) is to call the initialization routines to setup all the registers. I haven't used MCC much, but I seem to remember that main.c already includes this initialization by calling "system_init()" (or something like that), and this init function calls all the individual module init functions. |
|
|
|
让我更详细地说明我的方法。我在MCC中配置了所有的4CLC。它用一些其他配置文件生成了CL.H和CLC。我不希望那些CLC总是输出。我想在我的Meal.C程序中设置一些特定的条件来初始化它们。我想启用一个或多个。我检查了Microchip开发者帮助站点并在CLC ReavestStpP://MicroChIPDeavic.com上找到了有趣的信息:CcChanType这个部分:LCXEN—CLC模块启用位(1—CLC on,0关)LCXOE -输出使能位(1 -启用,0 -禁用)和ALSO ththtp://MyCHIPCDeave/COM/8BIT:CTCCONBIT 7LCXEN:可配置逻辑单元使能BIT1=可配置逻辑单元启用,混合输入信令0=可配置逻辑单元被禁用,并具有逻辑零输出位6LCXEOE:可配置逻辑单元输出使能BIT1=可配置逻辑CEnter端口引脚输出0=可配置逻辑单元端口引脚输出禁用我可以控制这些寄存器在我的主C程序吗?看看MCC生成的文件,似乎CLC都被自动内化了。有人能给我一个例子吗?
以上来自于百度翻译 以下为原文 Let me be more specific on my means. I've configured all the 4CLC in MCC. It generated some clc.h and clc.c, with some other config files. I dont want those CLC to be always outputing. I'd like to put some specific conditions in my main.c program to initialize them. I would like to enable one or more of them with a if() {}; function. I've check the microchip developer help site and found interesting infos on the CLC registers http://microchipdeveloper.com/8bit:clc specialy this part: LCxEN – CLC module enable bit (1 - CLC On, 0 - Off ) LCxOE – Output enable bit (1 – Enable, 0 – Disable) and also this http://microchipdeveloper.com/8bit:clccon bit 7 LCxEN: Configurable Logic Cell Enable bit 1 = Configurable logic cell is enabled and mixing input signals 0 = Configurable logic cell is disabled and has logic zero output bit 6 LCxEOE: Configurable Logic Cell Output Enable bit 1 = Configurable logic cell port pin output enabled 0 = Configurable logic cell port pin output disabled Can I control these registers in my main.c program? Looking at the MCC generated files it seems the CLC are all internalized automatically. Can someone give me an example of how it would like in the main.c program Thanks |
|
|
|
当然。MCC只是一个让你开始工作的框架。不要依赖它来为你做任何事情。你可以访问PIC数据表中记录的任何寄存器。
以上来自于百度翻译 以下为原文 Of course. MCC is just a framework to get you started. Don't rely on it to do everything for you. You can access any register documented in the PIC datasheet. |
|
|
|
Hiu可以通过管理“LCXEOE”标志来实现这一点。假设CLC输出被路由到外部,引脚。每当禁用CLC的输出时,相关联的PIN将被其LATX寄存器内容控制,您需要在LCX寄存器中填充具有安全值的LCAX寄存器,以使其处于活动状态,而CLC处于非活动状态。如果您有省电问题,则还应禁用CCS(LCXEN),而不需要N。产出。
以上来自于百度翻译 以下为原文 Hi You can achieve this by managing the "LCxEOE" flags. Assuming the CLC outputs are routed to teh outside, a pin. Whenever you disable the output of a CLC, the associated pin will be controled by its LATx register contents, you need to fill in the LATx registers with a safe value to be active while the CLC is inactive. If you have power saving concerns, you should also disable the CLCs (LCxEN) while you don't need their output. |
|
|
|
只有小组成员才能发言,加入小组>>
5160 浏览 9 评论
1998 浏览 8 评论
1927 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3170 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2225 浏览 5 评论
729浏览 1评论
613浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
503浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
628浏览 0评论
526浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 12:26 , Processed in 1.479752 second(s), Total 87, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号