Microchip
直播中

杜文渊

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

是否有可能读取PIC12F1571/2 MCU的内部时钟频率

大家好,想知道是否有可能读取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)

王焕树

2019-3-4 13:07:38
最好的办法是输出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..
举报

毛微

2019-3-4 13:21:38
嗨,谢谢你的回复。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
举报

蒋喜玲

2019-3-4 13:33:34
在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.
举报

王焕树

2019-3-4 13:53:32
我建议他们之间需要一根电线。很遗憾,你使用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.
 
举报

更多回帖

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