完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,想知道是否有可能读取PIC12F1571/ 2 MCU的内部时钟频率。我的应用程序需要两个单元同步。我发现,如果我有两个单元同时运行,两分钟后它们都会失去同步。我的应用程序使用这些MCU来控制一个光单位。目前,空间是一个我负担不起的奢侈。不是将外部高精度时钟连接到IC,而是有办法读取MCU的内部时钟频率并校正它,使灯不会失去同步。我不能使用任何通信协议。
以上来自于百度翻译 以下为原文 Hi All, Wanted to know if its possible to read the internal clock frequency of a pic12F1571/2 MCU. My application requires that two units be in synch. what I have found is that if I have two units running the same time, they both go out of synch after a couple of minutes. My application uses these MCUs to control a light unit. At the moment, space is a luxury I can't afford. rather than connecting an external high precision clock to the IC, Is there any way I can read the MCU's internal clock frequency and correct it so that the lights wont go out of synch. I cannot use any communication protocol. thanks Labmat. |
|
相关推荐
8个回答
|
|
最好的办法是输出1/4的内部时钟。第二个PIC可以在1/4时钟运行吗?否则,你可以得到主控器输出1ms信号(例如),并将其输入到第二个PIC上的中断输入,以获得定时。
以上来自于百度翻译 以下为原文 The best you can do is output 1/4 of the internal clock. Could the second PIC run at the 1/4 clock? Otherwise you could get the master to output a 1ms signal (for example), and feed that to an interrupt input on the second PIC to get your timing.. |
|
|
|
嗨,谢谢你的回复。MCUs在灯单元内,连接光的唯一电缆是电力电缆(与DC一起工作)。所以这两个灯是两个独立的实体。可能会有更多的灯连接到系统。我不能把中断信号从一个灯发送到另一个。关于前面提到的中断技术,你能告诉我这将如何工作吗?多谢,Labmat
以上来自于百度翻译 以下为原文 Hi, thanks for the reply. The MCUs are inside the light units and the only cables connecting the lights are the Power cables (working with DC here). So these two lights be two separate entities. there could be many more lights connected to the system. I cannot send the interrupt signal from one light to another. With regards to the interrupt technique you mentioned before, can you please let me know how this would work? Many thanks, Labmat |
|
|
|
在32 MHz内部运行,您可以在一个设备上输出CKOUT引脚上的FooC/4,将其作为PLKIN与PLL一起使用。然后这两个芯片将具有相同的工作频率并保持同步。
以上来自于百度翻译 以下为原文 Running at 32MHz internal, you can output Fosc/4 on CLKOUT pin on one device, use it as CLKIN on another with the PLL. Then both chips will have the same operating frequency and will stay in sync. >> I see this won't work in you're situation. |
|
|
|
我建议他们之间需要一根电线。很遗憾,你使用DC,或者你可以同步到电源频率。我假设你正在使用HFIFOTSC。这可以通过OSCTUNK寄存器稍微调整,但它仍然会随温度和电源电压变化。精度只有1%左右,如果你想要更好的精度,你需要一个外部晶体。
以上来自于百度翻译 以下为原文 What I suggested would require a wire between them. It's a pity you're using DC, or you could have synched to the supply frequency. I assume you are using the HFINTOSC. That can be slightly adjusted via the OSCTUNE register, but it will still vary a little with temperature and supply voltage. It's only accurate to about 1%. You need an external crystal if you want better precision. |
|
|
|
嗨,QHB,是的,你是对的。我正在使用HimtoSc。我在寻找一个不需要外部时钟的解决方案,因为我正在使用一个非常小的PCB占用空间(大约30mm DIA),但我想我可能不得不与外部时钟解决方案,并找到一种方法来适应它的所有。如果有任何其他解决方案,请让我知道。如果没有,非常感谢您的宝贵支持。)Labmat,干杯!
以上来自于百度翻译 以下为原文 Hi qhb, Yes, you are right. I am using the HFINTOSC. I was looking for a solution that didnt require an external clock as I'm working with a very small PCB footprint (approx. 30mm dia), but I suppose I may have to go with the external clock solution and find a way to fit all of it in. If there is any other solution, then please let me know. If not, thanks very much for your valuable support. :) cheers, Labmat |
|
|
|
外部时钟没有帮助,除非它是GPS纪律或其他锁定到一些外部参考。使用晶体振荡器只会增加它们在“同步”中的停留时间。一个50ppm(005)晶体/振荡器将只需200倍,只要在PIC的1%振荡器。除非你不时地得到外部同步,否则它们会漂移开来。如果需要长期的同步,你必须在两者之间有一根导线。我想你可以尝试某种电力线通信-通过一个上限(通过额外的TVS保护)将IO引脚连接到电源信号,并发送方波-也许你可以得到足够的信号来检测另一个PIC -但是这可能有负面的EMC后果。
以上来自于百度翻译 以下为原文 An external clock doesn't help, unless it's GPS disciplined or otherwise locked to some external reference. Using a crystal oscillator just increases the time they stay "in sync". A 50ppm (.005%) crystal/oscillator will just take 200x as long as the ~ 1% oscillator in the PIC. Unless you get external synchronization from time to time, they will drift apart. You will have to have a wire between the two if long term synchronization is required. I suppose you could try some kind of power line communication - tie an IO pin to the power signal through a cap (with extra TVS protection) and send a square wave - maybe you can get enough signal to detect at the other PIC - but this probably has negative EMC consequences. |
|
|
|
你不能在没有参考的情况下在内部测量频率。如果没有一些外部公共参考,就不可能进行同步。每个单元上的个别高精度时钟将由于组件公差和局部环境变化而失去同步。问题。在电源链路上发送数据的方式有很多种。增加一位同步脉冲不会太困难,但需要重新设计模块。
以上来自于百度翻译 以下为原文 You can't measure the frequency internally without having a reference. It's simply not possible to synchronise without some external common reference. Even individual high precision clocks on each unit WILL go out of synch due to component tolerances and local environmental variations. Using DC is no problem. There are many ways to send data over a power supply link. Adding a one bit synch pulse would not be too difficult, but would require a redesign of the module. |
|
|
|
Hiu不会是第一个在电力线上叠加通信信道的人,而DC电源则相当简单。我只有2美分。
以上来自于百度翻译 以下为原文 Hi You wouldn't be the first one to superimpose a comunication channel over power lines., And with DC power its quite easy. Just my 2 cents.... Best regards Jorge |
|
|
|
只有小组成员才能发言,加入小组>>
5244 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3209 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2260 浏览 5 评论
779浏览 1评论
672浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
598浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
682浏览 0评论
579浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 10:33 , Processed in 1.455404 second(s), Total 91, Slave 74 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号