Microchip
直播中

张媛媛

7年用户 171经验值
私信 关注
[问答]

如何在满足特定条件时调用CLC重新路由信号引脚

我对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)

tijing忽忽

2018-9-14 16:19:25
我想你可能需要更具体地说明这一点:“我正在寻找一种方法来将信号从一个引脚重新路由到另一个。”这个:“我想知道如何在主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?"
举报

蒋喜玲

2018-9-14 16:29:49
如果您已经在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.
 
 
举报

张宁

2018-9-14 16:46:51
让我更详细地说明我的方法。我在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
 
举报

吴键洪

2018-9-14 16:52:17
当然。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.
 
举报

更多回帖

发帖
×
20
完善资料,
赚取积分